public final Object getRealObject ( Object objectOrProxy ) { if ( isNormalOjbProxy ( objectOrProxy ) ) { String msg ; try { return getIndirectionHandler ( objectOrProxy ) . getRealSubject ( ) ; } catch ( ClassCastException e ) { // shouldn't happen but still ... msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler . class . getName ( ) ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( IllegalArgumentException e ) { msg = "Could not retrieve real object for given Proxy: " + objectOrProxy ; log . error ( msg ) ; throw new PersistenceBrokerException ( msg , e ) ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for given Proxy: " + objectOrProxy ) ; throw e ; } } else if ( isVirtualOjbProxy ( objectOrProxy ) ) { try { return ( ( VirtualProxy ) objectOrProxy ) . getRealSubject ( ) ; } catch ( PersistenceBrokerException e ) { log . error ( "Could not retrieve real object for VirtualProxy: " + objectOrProxy ) ; throw e ; } } else { return objectOrProxy ; } }
Get the real Object