|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ProxyFactory
Factory class for creating instances of the indirection handler used by OJB's proxies, and for the collection proxies.
Method Summary | |
---|---|
ManageableCollection |
createCollectionProxy(PBKey brokerKey,
Query query,
java.lang.Class collectionClass)
Create a Collection Proxy for a given context. |
IndirectionHandler |
createIndirectionHandler(PBKey pbKey,
Identity id)
Creates a new indirection handler instance. |
OJBProxy |
createProxy(java.lang.Class baseClass,
IndirectionHandler handler)
|
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. |
java.lang.Class |
getDefaultIndirectionHandlerClass()
Returns the class of a default IndirectionHandler that can be used for this implementaiton if now IndirectionHandlerClass implementation is given. |
IndirectionHandler |
getIndirectionHandler(java.lang.Object obj)
Returns the invocation handler object of the given proxy object. |
java.lang.Class |
getIndirectionHandlerBaseClass()
Returns the class of the base class that the given IndirectionHandler must extend/implement |
java.lang.Class |
getIndirectionHandlerClass()
Returns the indirection handler class. |
java.lang.Class |
getListProxyClass()
Returns the list proxy class. |
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 |
interfaceRequiredForProxyGeneration()
Method that returns whether or not this ProxyFactory can generate reference Proxies for classes regardless if they extend an interface or not. |
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. |
Method Detail |
---|
java.lang.Class getIndirectionHandlerClass()
void setIndirectionHandlerClass(java.lang.Class indirectionHandlerClass)
indirectionHandlerClass
- The class for indirection handlersjava.lang.Class getDefaultIndirectionHandlerClass()
java.lang.Class getIndirectionHandlerBaseClass()
IndirectionHandler createIndirectionHandler(PBKey pbKey, Identity id)
persistenceConf
- The persistence configurationid
- The subject's ids
java.lang.Class getListProxyClass()
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
).
listProxyClass
- The proxy classjava.lang.Class getSetProxyClass()
void setSetProxyClass(java.lang.Class setProxyClass)
Set
interface.
setProxyClass
- The proxy classjava.lang.Class getCollectionProxyClass()
void setCollectionProxyClass(java.lang.Class collectionProxyClass)
Collection
interface.
collectionProxyClass
- The proxy classManageableCollection createCollectionProxy(PBKey brokerKey, Query query, java.lang.Class collectionClass)
persistenceConf
- The persistence configuration that the proxy will be bound tocontext
- The creation context
OJBProxy createProxy(java.lang.Class baseClass, IndirectionHandler handler) throws java.lang.Exception
java.lang.Exception
java.lang.Object getRealObject(java.lang.Object objectOrProxy)
objectOrProxy
-
java.lang.Object getRealObjectIfMaterialized(java.lang.Object objectOrProxy)
objectOrProxy
-
java.lang.Class getRealClass(java.lang.Object objectOrProxy)
objectOrProxy
-
boolean isNormalOjbProxy(java.lang.Object proxyOrObject)
true
if the object is an OJB proxyboolean isVirtualOjbProxy(java.lang.Object proxyOrObject)
true
if the object is an OJB virtual proxyboolean isProxy(java.lang.Object proxyOrObject)
Proxy
or a VirtualProxy
instance.
IndirectionHandler getIndirectionHandler(java.lang.Object obj)
obj
- The object
null
otherwiseboolean isMaterialized(java.lang.Object object)
object
- The object to test
true
if the object is materializedCollectionProxy getCollectionProxy(java.lang.Object item)
boolean isCollectionProxy(java.lang.Object item)
java.lang.String toString(java.lang.Object proxy)
object
- The object for which a string representation shall be generated
boolean interfaceRequiredForProxyGeneration()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |