public abstract class AbstractProxyFactory extends java.lang.Object implements ProxyFactory
Constructor and Description |
---|
AbstractProxyFactory() |
Modifier and Type | Method and Description |
---|---|
ManageableCollection |
createCollectionProxy(PBKey brokerKey,
Query query,
java.lang.Class collectionClass)
Create a Collection Proxy for a given query.
|
IndirectionHandler |
createIndirectionHandler(PBKey brokerKey,
Identity id)
Creates a new indirection handler instance.
|
CollectionProxy |
getCollectionProxy(java.lang.Object item)
Return CollectionProxy for item is item is a CollectionProxy, otherwise return null
|
java.lang.Class |
getCollectionProxyClass()
Returns the collection proxy class.
|
IndirectionHandler |
getIndirectionHandler(java.lang.Object obj)
Returns the invocation handler object of the given proxy object.
|
java.lang.Class |
getIndirectionHandlerClass()
Returns the indirection handler class.
|
java.lang.Class |
getListProxyClass()
Returns the list proxy class.
|
static ProxyFactory |
getProxyFactory() |
java.lang.Class |
getRealClass(java.lang.Object objectOrProxy)
Get the real Class
|
java.lang.Object |
getRealObject(java.lang.Object objectOrProxy)
Get the real Object
|
java.lang.Object |
getRealObjectIfMaterialized(java.lang.Object objectOrProxy)
Get the real Object for already materialized Handler
|
java.lang.Class |
getSetProxyClass()
Returns the set proxy class.
|
boolean |
isCollectionProxy(java.lang.Object item)
Reports if item is a CollectionProxy.
|
boolean |
isMaterialized(java.lang.Object object)
Determines whether the object is a materialized object, i.e.
|
boolean |
isNormalOjbProxy(java.lang.Object proxyOrObject)
Determines whether the given object is an OJB proxy.
|
boolean |
isProxy(java.lang.Object proxyOrObject)
Returns true if the given object is a
Proxy
or a VirtualProxy instance. |
boolean |
isVirtualOjbProxy(java.lang.Object proxyOrObject)
Determines whether the given object is an OJB virtual proxy.
|
void |
setCollectionProxyClass(java.lang.Class collectionProxyClass)
Dets the proxy class to use for generic collection classes implementing the
Collection interface. |
void |
setIndirectionHandlerClass(java.lang.Class indirectionHandlerClass)
Sets the indirection handler class.
|
void |
setListProxyClass(java.lang.Class listProxyClass)
Dets the proxy class to use for collection classes that implement the
List interface. |
void |
setSetProxyClass(java.lang.Class setProxyClass)
Dets the proxy class to use for collection classes that implement the
Set interface. |
java.lang.String |
toString(java.lang.Object proxy)
Materialization-safe version of toString.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createProxy, getDefaultIndirectionHandlerClass, getIndirectionHandlerBaseClass, interfaceRequiredForProxyGeneration
public java.lang.Class getIndirectionHandlerClass()
getIndirectionHandlerClass
in interface ProxyFactory
public void setIndirectionHandlerClass(java.lang.Class indirectionHandlerClass)
setIndirectionHandlerClass
in interface ProxyFactory
indirectionHandlerClass
- The class for indirection handlerspublic IndirectionHandler createIndirectionHandler(PBKey brokerKey, Identity id)
createIndirectionHandler
in interface ProxyFactory
brokerKey
- The associated PBKey
.id
- The subject's idspublic java.lang.Class getListProxyClass()
getListProxyClass
in interface ProxyFactory
public void setListProxyClass(java.lang.Class listProxyClass)
List
interface.
Notes that the proxy class must implement the List
interface, and have a constructor
of the signature (PBKey
, Class
, Query
).setListProxyClass
in interface ProxyFactory
listProxyClass
- The proxy classpublic java.lang.Class getSetProxyClass()
getSetProxyClass
in interface ProxyFactory
public void setSetProxyClass(java.lang.Class setProxyClass)
Set
interface.setSetProxyClass
in interface ProxyFactory
setProxyClass
- The proxy classpublic java.lang.Class getCollectionProxyClass()
getCollectionProxyClass
in interface ProxyFactory
public void setCollectionProxyClass(java.lang.Class collectionProxyClass)
Collection
interface.setCollectionProxyClass
in interface ProxyFactory
collectionProxyClass
- The proxy classpublic ManageableCollection createCollectionProxy(PBKey brokerKey, Query query, java.lang.Class collectionClass)
createCollectionProxy
in interface ProxyFactory
brokerKey
- The key of the persistence brokerquery
- The querycollectionClass
- The class to build the proxy forpublic final java.lang.Object getRealObject(java.lang.Object objectOrProxy)
getRealObject
in interface ProxyFactory
objectOrProxy
- public java.lang.Object getRealObjectIfMaterialized(java.lang.Object objectOrProxy)
getRealObjectIfMaterialized
in interface ProxyFactory
objectOrProxy
- public java.lang.Class getRealClass(java.lang.Object objectOrProxy)
getRealClass
in interface ProxyFactory
objectOrProxy
- public boolean isNormalOjbProxy(java.lang.Object proxyOrObject)
isNormalOjbProxy
in interface ProxyFactory
true
if the object is an OJB proxypublic boolean isVirtualOjbProxy(java.lang.Object proxyOrObject)
isVirtualOjbProxy
in interface ProxyFactory
true
if the object is an OJB virtual proxypublic boolean isProxy(java.lang.Object proxyOrObject)
Proxy
or a VirtualProxy
instance.isProxy
in interface ProxyFactory
public IndirectionHandler getIndirectionHandler(java.lang.Object obj)
getIndirectionHandler
in interface ProxyFactory
obj
- The objectnull
otherwisepublic boolean isMaterialized(java.lang.Object object)
isMaterialized
in interface ProxyFactory
object
- The object to testtrue
if the object is materializedpublic CollectionProxy getCollectionProxy(java.lang.Object item)
getCollectionProxy
in interface ProxyFactory
public boolean isCollectionProxy(java.lang.Object item)
isCollectionProxy
in interface ProxyFactory
public java.lang.String toString(java.lang.Object proxy)
toString
in interface ProxyFactory
proxy
- The object for which a string representation shall be generatedpublic static ProxyFactory getProxyFactory()
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30