| java.lang.Object org.jaffa.persistence.engines.jdbcengine.proxy.PersistentInstanceFactory
PersistentInstanceFactory | public class PersistentInstanceFactory (Code) | | This class is a factory for obtaining IPersistent instances.
|
Method Summary | |
public static Class | getActualPersistentClass(IPersistent object) This is a helper method to determine the actual class which was used to create an IPersistent instance.
It is quite possible that the input object is a dynamic proxy.
Parameters: object - The object which implements the IPersistent instance. | public static IPersistent | newPersistentInstance(Class persistentClass) Generates an appropriate instance for the input persistentClass.
If the persistentClass is a 'Class', then it should implement the 'IPersistent' interface. | public static void | setInstanceValue(IPersistent object, String attributeName, Object value) This is used by the MoldingService to initialize the Persistent instance. |
getActualPersistentClass | public static Class getActualPersistentClass(IPersistent object)(Code) | | This is a helper method to determine the actual class which was used to create an IPersistent instance.
It is quite possible that the input object is a dynamic proxy.
Parameters: object - The object which implements the IPersistent instance. The class which was used for instantiating the instance. |
newPersistentInstance | public static IPersistent newPersistentInstance(Class persistentClass)(Code) | | Generates an appropriate instance for the input persistentClass.
If the persistentClass is a 'Class', then it should implement the 'IPersistent' interface. The persistence engine will simply instantiate the class.
If the persistentClass is an 'Interface', then the persistence engine will generate a dynamic proxy, to implement the IPersistent and the 'persistentClass' interfaces.
A RuntimeException will be thrown if any error occurs during instantiation.
Parameters: persistentClass - The actual persistentClass which can represent a 'Class' or an 'Interface' an instance implementing the IPersistent interface. |
setInstanceValue | public static void setInstanceValue(IPersistent object, String attributeName, Object value)(Code) | | This is used by the MoldingService to initialize the Persistent instance.
This will merely add the attribute/value to the Map in the PersistentInstanceInvocationHandler.
This will bypass the validations performed during invocation of the setXyz() method on the persistent object.
Nothing will be done if the input object is not a Proxy or if its InvocationHandler is not an instance of PersistentInstanceInvocationHandler.
Parameters: object - The Proxy object for an IPersistence interface. Parameters: attributeName - The attribute whose value will be set. Parameters: value - The value to be set. |
|
|