|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ejb.plugins.CMPClusteredInMemoryPersistenceManager
EntityPersistenceStore implementation storing values in-memory and shared accross the cluster through the DistributedState service from the clustering framework. It always uses the DefaultPartition.
EntityPersistenceStore
,
CMPInMemoryPersistenceManager
,
DistributedState
Field Summary | |
protected org.jboss.ejb.EntityContainer |
con
|
protected DistributedState |
ds
|
protected String |
DS_CATEGORY
|
protected Field |
idField
|
protected Method |
isModified
Optional isModified method used by storeEntity |
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags |
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED |
Constructor Summary | |
CMPClusteredInMemoryPersistenceManager()
|
Method Summary | |
void |
activateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
This method is called when an entity shall be activated. |
void |
create()
create the service, do expensive operations etc |
Object |
createBeanClassInstance()
Returns a new instance of the bean class or a subclass of the bean class. |
Object |
createEntity(Method m,
Object[] args,
org.jboss.ejb.EntityEnterpriseContext ctx)
This method is called whenever an entity is to be created. |
void |
destroy()
destroy the service, tear down |
Collection |
findEntities(Method finderMethod,
Object[] args,
org.jboss.ejb.EntityEnterpriseContext instance,
org.jboss.ejb.GenericEntityObjectFactory factory)
This method is called when collections of entities are to be found. |
Object |
findEntity(Method finderMethod,
Object[] args,
org.jboss.ejb.EntityEnterpriseContext instance,
org.jboss.ejb.GenericEntityObjectFactory factory)
This method is called when single entities are to be found. |
void |
initEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
Initializes the instance context. |
boolean |
isModified(org.jboss.ejb.EntityEnterpriseContext ctx)
|
boolean |
isStoreRequired(org.jboss.ejb.EntityEnterpriseContext ctx)
This method is used to determine if an entity should be stored. |
void |
loadEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
This method is called whenever an entity shall be load from the underlying storage. |
void |
passivateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
This method is called when an entity shall be passivate. |
Object |
postCreateEntity(Method m,
Object[] args,
org.jboss.ejb.EntityEnterpriseContext ctx)
This method is called after the ejbCreate. |
void |
removeEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
This method is called when an entity shall be removed from the underlying storage. |
void |
setContainer(org.jboss.ejb.Container con)
This callback is set by the container so that the plugin may access it |
void |
start()
start the service, create is already called |
void |
stop()
stop the service |
void |
storeEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
This method is called whenever an entity shall be stored to the underlying storage. |
protected void |
storeEntity(Object id,
Object obj)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.jboss.ejb.EntityContainer con
protected Field idField
protected DistributedState ds
protected String DS_CATEGORY
protected Method isModified
Constructor Detail |
public CMPClusteredInMemoryPersistenceManager()
Method Detail |
public void setContainer(org.jboss.ejb.Container con)
setContainer
in interface org.jboss.ejb.ContainerPlugin
con
- The container using this plugin.public void create() throws Exception
create
in interface org.jboss.system.Service
Exception
public void start() throws Exception
start
in interface org.jboss.system.Service
Exception
public void stop()
stop
in interface org.jboss.system.Service
public void destroy()
destroy
in interface org.jboss.system.Service
public Object createBeanClassInstance() throws Exception
createBeanClassInstance
in interface org.jboss.ejb.EntityPersistenceStore
Exception
public void initEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
This method is called before createEntity, and should reset the value of all cmpFields to 0 or null.
initEntity
in interface org.jboss.ejb.EntityPersistenceStore
ctx
- public Object createEntity(Method m, Object[] args, org.jboss.ejb.EntityEnterpriseContext ctx) throws Exception
createEntity
in interface org.jboss.ejb.EntityPersistenceStore
m
- the create method in the home interface that was
calledargs
- any create parametersctx
- the instance ctx being used for this create call
Exception
public Object postCreateEntity(Method m, Object[] args, org.jboss.ejb.EntityEnterpriseContext ctx) throws Exception
postCreateEntity
in interface org.jboss.ejb.EntityPersistenceStore
m
- the ejbPostCreate method in the bean class that was
calledargs
- any create parametersctx
- the instance being used for this create call
Exception
public Object findEntity(Method finderMethod, Object[] args, org.jboss.ejb.EntityEnterpriseContext instance, org.jboss.ejb.GenericEntityObjectFactory factory) throws Exception
findEntity
in interface org.jboss.ejb.EntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersinstance
- the instance to use for the finder call
RemoteException
- thrown if some system exception occurs
javax.ejb.FinderException
- thrown if some heuristic problem occurs
Exception
public Collection findEntities(Method finderMethod, Object[] args, org.jboss.ejb.EntityEnterpriseContext instance, org.jboss.ejb.GenericEntityObjectFactory factory) throws Exception
findEntities
in interface org.jboss.ejb.EntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersinstance
- the instance to use for the finder call
RemoteException
- thrown if some system exception occurs
javax.ejb.FinderException
- thrown if some heuristic problem occurs
Exception
public void activateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
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.
activateEntity
in interface org.jboss.ejb.EntityPersistenceStore
instance
- the instance to use for the activation
RemoteException
- thrown if some system exception occurspublic void loadEntity(org.jboss.ejb.EntityEnterpriseContext ctx)
loadEntity
in interface org.jboss.ejb.EntityPersistenceStore
ctx
- the instance to synchronize
RemoteException
- thrown if some system exception occurspublic boolean isStoreRequired(org.jboss.ejb.EntityEnterpriseContext ctx) throws Exception
isStoreRequired
in interface org.jboss.ejb.EntityPersistenceStore
ctx
- the instance to check
Exception
- thrown if some system exception occurspublic boolean isModified(org.jboss.ejb.EntityEnterpriseContext ctx) throws Exception
isModified
in interface org.jboss.ejb.EntityPersistenceStore
Exception
public void storeEntity(org.jboss.ejb.EntityEnterpriseContext ctx) throws RemoteException
storeEntity
in interface org.jboss.ejb.EntityPersistenceStore
ctx
- the instance to synchronize
RemoteException
- thrown if some system exception occurspublic void passivateEntity(org.jboss.ejb.EntityEnterpriseContext instance)
See the activate discussion for the reason for exposing EJB callback calls to the store.
passivateEntity
in interface org.jboss.ejb.EntityPersistenceStore
instance
- the instance to passivate
RemoteException
- thrown if some system exception occurspublic void removeEntity(org.jboss.ejb.EntityEnterpriseContext ctx) throws javax.ejb.RemoveException
removeEntity
in interface org.jboss.ejb.EntityPersistenceStore
ctx
- the instance to remove
RemoteException
- thrown if some system exception occurs
javax.ejb.RemoveException
- thrown if the instance could not be removedprotected void storeEntity(Object id, Object obj) throws Exception
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |