ojb.broker
Class VirtualProxy

java.lang.Object
  |
  +--ojb.broker.VirtualProxy
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ArticleProxy, ProductGroupProxy

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

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

See Also:
Serialized Form

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 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
 

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 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.

Parameters:
proxyClass - java.lang.Class
realSubjectsIdentity - ojb.broker.Identity
Returns:
ojb.app.VirtualProxy
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException

getRealSubject

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

PersistenceBrokerException

getIdentity

Identity getIdentity()


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04