|
||||||||||
| 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,
Class collectionClass)
Create a Collection Proxy for a given context. |
IndirectionHandler |
createIndirectionHandler(PBKey pbKey,
Identity id)
Creates a new indirection handler instance. |
OJBProxy |
createProxy(Class baseClass,
IndirectionHandler handler)
|
CollectionProxy |
getCollectionProxy(Object item)
Return CollectionProxy for item is item is a CollectionProxy, otherwise return null |
Class |
getCollectionProxyClass()
Returns the collection proxy class. |
Class |
getDefaultIndirectionHandlerClass()
Returns the class of a default IndirectionHandler that can be used for this implementaiton if now IndirectionHandlerClass implementation is given. |
IndirectionHandler |
getIndirectionHandler(Object obj)
Returns the invocation handler object of the given proxy object. |
Class |
getIndirectionHandlerBaseClass()
Returns the class of the base class that the given IndirectionHandler must extend/implement |
Class |
getIndirectionHandlerClass()
Returns the indirection handler class. |
Class |
getListProxyClass()
Returns the list proxy class. |
Class |
getRealClass(Object objectOrProxy)
Get the real Class |
Object |
getRealObject(Object objectOrProxy)
Get the real Object |
Object |
getRealObjectIfMaterialized(Object objectOrProxy)
Get the real Object for already materialized Handler |
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(Object item)
Reports if item is a CollectionProxy. |
boolean |
isMaterialized(Object object)
Determines whether the object is a materialized object, i.e. |
boolean |
isNormalOjbProxy(Object proxyOrObject)
Determines whether the given object is an OJB proxy. |
boolean |
isProxy(Object proxyOrObject)
Returns true if the given object is a Proxy
or a VirtualProxy instance. |
boolean |
isVirtualOjbProxy(Object proxyOrObject)
Determines whether the given object is an OJB virtual proxy. |
void |
setCollectionProxyClass(Class collectionProxyClass)
Dets the proxy class to use for generic collection classes implementing the Collection interface. |
void |
setIndirectionHandlerClass(Class indirectionHandlerClass)
Sets the indirection handler class. |
void |
setListProxyClass(Class listProxyClass)
Dets the proxy class to use for collection classes that implement the List interface. |
void |
setSetProxyClass(Class setProxyClass)
Dets the proxy class to use for collection classes that implement the Set interface. |
String |
toString(Object proxy)
Materialization-safe version of toString. |
| Method Detail |
|---|
Class getIndirectionHandlerClass()
void setIndirectionHandlerClass(Class indirectionHandlerClass)
indirectionHandlerClass - The class for indirection handlersClass getDefaultIndirectionHandlerClass()
Class getIndirectionHandlerBaseClass()
IndirectionHandler createIndirectionHandler(PBKey pbKey,
Identity id)
persistenceConf - The persistence configurationid - The subject's ids
Class getListProxyClass()
void setListProxyClass(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 classClass getSetProxyClass()
void setSetProxyClass(Class setProxyClass)
Set interface.
setProxyClass - The proxy classClass getCollectionProxyClass()
void setCollectionProxyClass(Class collectionProxyClass)
Collection interface.
collectionProxyClass - The proxy class
ManageableCollection createCollectionProxy(PBKey brokerKey,
Query query,
Class collectionClass)
persistenceConf - The persistence configuration that the proxy will be bound tocontext - The creation context
OJBProxy createProxy(Class baseClass,
IndirectionHandler handler)
throws Exception
ExceptionObject getRealObject(Object objectOrProxy)
objectOrProxy -
Object getRealObjectIfMaterialized(Object objectOrProxy)
objectOrProxy -
Class getRealClass(Object objectOrProxy)
objectOrProxy -
boolean isNormalOjbProxy(Object proxyOrObject)
true if the object is an OJB proxyboolean isVirtualOjbProxy(Object proxyOrObject)
true if the object is an OJB virtual proxyboolean isProxy(Object proxyOrObject)
Proxy
or a VirtualProxy instance.
IndirectionHandler getIndirectionHandler(Object obj)
obj - The object
null
otherwiseboolean isMaterialized(Object object)
object - The object to test
true if the object is materializedCollectionProxy getCollectionProxy(Object item)
boolean isCollectionProxy(Object item)
String toString(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 | |||||||||