| java.lang.Object org.jboss.ejb.plugins.CMPClusteredInMemoryPersistenceManager
CMPClusteredInMemoryPersistenceManager | public class CMPClusteredInMemoryPersistenceManager implements org.jboss.ejb.EntityPersistenceStore(Code) | | EntityPersistenceStore implementation storing values in-memory
and shared accross the cluster through the DistributedState service
from the clustering framework. It always uses the DefaultPartition.
See Also: org.jboss.ejb.EntityPersistenceStore See Also: org.jboss.ejb.plugins.CMPInMemoryPersistenceManager See Also: org.jboss.ha.framework.interfaces.DistributedState author: Sacha Labourey. version: $Revision: 57188 $ |
Method Summary | |
public void | activateEntity(EntityEnterpriseContext instance) This method is called when an entity shall be activated.
With the PersistenceManager factorization most EJB calls should not
exists However this calls permits us to introduce optimizations in
the persistence store. | public void | create() | public Object | createBeanClassInstance() Returns a new instance of the bean class or a subclass of the bean class. | public Object | createEntity(Method m, Object[] args, EntityEnterpriseContext ctx) This method is called whenever an entity is to be created. | public void | destroy() | public Collection | findEntities(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) This method is called when collections of entities are to be found. | public Object | findEntity(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) This method is called when single entities are to be found. | public void | initEntity(EntityEnterpriseContext ctx) Initializes the instance context. | public boolean | isModified(EntityEnterpriseContext ctx) | public boolean | isStoreRequired(EntityEnterpriseContext ctx) This method is used to determine if an entity should be stored. | public void | loadEntity(EntityEnterpriseContext ctx) This method is called whenever an entity shall be load from the
underlying storage. | public void | passivateEntity(EntityEnterpriseContext instance) This method is called when an entity shall be passivate. | public Object | postCreateEntity(Method m, Object[] args, EntityEnterpriseContext ctx) This method is called after the ejbCreate. | public void | removeEntity(EntityEnterpriseContext ctx) This method is called when an entity shall be removed from the
underlying storage. | public void | setContainer(org.jboss.ejb.Container con) | public void | start() | public void | stop() | public void | storeEntity(EntityEnterpriseContext ctx) This method is called whenever an entity shall be stored to the
underlying storage. | protected void | storeEntity(Object id, Object obj) |
con | protected org.jboss.ejb.EntityContainer con(Code) | | |
isModified | protected Method isModified(Code) | | Optional isModified method used by storeEntity
|
CMPClusteredInMemoryPersistenceManager | public CMPClusteredInMemoryPersistenceManager()(Code) | | |
activateEntity | public void activateEntity(EntityEnterpriseContext instance)(Code) | | This method is called when an entity shall be activated.
With the PersistenceManager factorization most EJB calls should not
exists However this calls permits us to introduce optimizations in
the persistence store. Particularly the context has a
"PersistenceContext" that a PersistenceStore can use (JAWS does for
smart updates) and this is as good a callback as any other to set it
up.
Parameters: instance - the instance to use for the activation throws: java.rmi.RemoteException - thrown if some system exception occurs |
create | public void create() throws Exception(Code) | | create the service, do expensive operations etc
|
createBeanClassInstance | public Object createBeanClassInstance() throws Exception(Code) | | Returns a new instance of the bean class or a subclass of the bean class.
the new instance throws: Exception - |
createEntity | public Object createEntity(Method m, Object[] args, EntityEnterpriseContext ctx) throws Exception(Code) | | This method is called whenever an entity is to be created.
The persistence manager is responsible for handling the results properly
wrt the persistent store.
Parameters: m - the create method in the home interface that wascalled Parameters: args - any create parameters Parameters: ctx - the instance ctx being used for this create call The primary key computed by CMP PM or null for BMP throws: Exception - |
destroy | public void destroy()(Code) | | destroy the service, tear down
|
findEntities | public Collection findEntities(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception(Code) | | This method is called when collections of entities are to be found. The
persistence manager must find out whether the wanted instances are
available in the persistence store, and if so it must return a
collection of primaryKeys.
Parameters: finderMethod - the find method in the home interface that wascalled Parameters: args - any finder parameters Parameters: instance - the instance to use for the finder call an primary key collection representing the foundentities throws: java.rmi.RemoteException - thrown if some system exception occurs throws: javax.ejb.FinderException - thrown if some heuristic problem occurs |
findEntity | public Object findEntity(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception(Code) | | This method is called when single entities are to be found. The
persistence manager must find out whether the wanted instance is
available in the persistence store, if so it returns the primary key of
the object.
Parameters: finderMethod - the find method in the home interface that wascalled Parameters: args - any finder parameters Parameters: instance - the instance to use for the finder call a primary key representing the found entity throws: java.rmi.RemoteException - thrown if some system exception occurs throws: javax.ejb.FinderException - thrown if some heuristic problem occurs |
initEntity | public void initEntity(EntityEnterpriseContext ctx)(Code) | | Initializes the instance context.
This method is called before createEntity, and should
reset the value of all cmpFields to 0 or null.
Parameters: ctx - |
isModified | public boolean isModified(EntityEnterpriseContext ctx) throws Exception(Code) | | |
isStoreRequired | public boolean isStoreRequired(EntityEnterpriseContext ctx) throws Exception(Code) | | This method is used to determine if an entity should be stored.
Parameters: ctx - the instance to check true, if the entity has been modified throws: Exception - thrown if some system exception occurs |
loadEntity | public void loadEntity(EntityEnterpriseContext ctx)(Code) | | This method is called whenever an entity shall be load from the
underlying storage. The persistence manager must load the state from
the underlying storage and then call ejbLoad on the supplied instance.
Parameters: ctx - the instance to synchronize throws: java.rmi.RemoteException - thrown if some system exception occurs |
passivateEntity | public void passivateEntity(EntityEnterpriseContext instance)(Code) | | This method is called when an entity shall be passivate. The persistence
manager must call the ejbPassivate method on the instance.
See the activate discussion for the reason for exposing EJB callback
calls to the store.
Parameters: instance - the instance to passivate throws: java.rmi.RemoteException - thrown if some system exception occurs |
postCreateEntity | public Object postCreateEntity(Method m, Object[] args, EntityEnterpriseContext ctx) throws Exception(Code) | | This method is called after the ejbCreate.
The persistence manager is responsible for handling the results properly
wrt the persistent store.
Parameters: m - the ejbPostCreate method in the bean class that wascalled Parameters: args - any create parameters Parameters: ctx - the instance being used for this create call The primary key computed by CMP PM or null for BMP throws: Exception - |
removeEntity | public void removeEntity(EntityEnterpriseContext ctx) throws javax.ejb.RemoveException(Code) | | This method is called when an entity shall be removed from the
underlying storage. The persistence manager must call ejbRemove on the
instance and then remove its state from the underlying storage.
Parameters: ctx - the instance to remove throws: java.rmi.RemoteException - thrown if some system exception occurs throws: javax.ejb.RemoveException - thrown if the instance could not be removed |
setContainer | public void setContainer(org.jboss.ejb.Container con)(Code) | | This callback is set by the container so that the plugin may access it
Parameters: con - The container using this plugin. |
start | public void start() throws Exception(Code) | | start the service, create is already called
|
stop | public void stop()(Code) | | stop the service
|
storeEntity | public void storeEntity(EntityEnterpriseContext ctx) throws java.rmi.RemoteException(Code) | | This method is called whenever an entity shall be stored to the
underlying storage. The persistence manager must call ejbStore on the
supplied instance and then store the state to the underlying storage.
B
Parameters: ctx - the instance to synchronize throws: java.rmi.RemoteException - thrown if some system exception occurs |
|
|