Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ojb.broker
Class VirtualProxy  view VirtualProxy download VirtualProxy.java

java.lang.Object
  extended byojb.broker.VirtualProxy
All Implemented Interfaces:
java.io.Serializable

public abstract class VirtualProxy
extends java.lang.Object
implements java.io.Serializable

Proxy base class. can be used to implement lazy materialization techniques.


Field Summary
private  ojb.broker.accesslayer.IndirectionHandler indirectionHandler
          reference to the IndirectionHandler that encapsulates the delegation mechanism
 
Constructor Summary
VirtualProxy()
           
VirtualProxy(Identity oid)
          create a VirtualProxy from an identity
VirtualProxy(java.lang.reflect.InvocationHandler handler)
          create a VirtualProxy from an identity
 
Method Summary
 boolean alreadyMaterialized()
          returns true if the real subject already been loaded
static java.lang.Object createProxy(java.lang.Class proxyClass, Identity realSubjectsIdentity)
          static factory method creates VirtualProxy instances of a given subclass and an real subjects identity.
(package private)  Identity getIdentity()
           
static ojb.broker.accesslayer.IndirectionHandler getIndirectionHandler(VirtualProxy proxy)
           
 java.lang.Object getRealSubject()
          returns the proxies real subject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indirectionHandler

private ojb.broker.accesslayer.IndirectionHandler indirectionHandler
reference to the IndirectionHandler that encapsulates the delegation mechanism

Constructor Detail

VirtualProxy

public VirtualProxy()

VirtualProxy

public VirtualProxy(Identity oid)
create a VirtualProxy from an identity


VirtualProxy

public VirtualProxy(java.lang.reflect.InvocationHandler handler)
create a VirtualProxy from an identity

Method Detail

getIndirectionHandler

public static ojb.broker.accesslayer.IndirectionHandler getIndirectionHandler(VirtualProxy proxy)

alreadyMaterialized

public boolean alreadyMaterialized()
returns true if the real subject already been loaded


createProxy

public static java.lang.Object createProxy(java.lang.Class proxyClass,
                                           Identity realSubjectsIdentity)
                                    throws java.lang.InstantiationException,
                                           java.lang.IllegalAccessException,
                                           java.lang.NoSuchMethodException,
                                           java.lang.reflect.InvocationTargetException
static factory method creates VirtualProxy instances of a given subclass and an real subjects identity.


getRealSubject

public java.lang.Object getRealSubject()
                                throws PersistenceBrokerException
returns the proxies real subject. The subject will be materialized if necessary.


getIdentity

Identity getIdentity()