|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.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
(src) ,
CMPInMemoryPersistenceManager
(src) ,
DistributedState
(src) Field Summary | |
protected EntityContainer (src) |
con
|
protected DistributedState (src) |
ds
|
protected java.lang.String |
DS_CATEGORY
|
protected java.lang.reflect.Field |
idField
|
protected java.lang.reflect.Method |
isModified
Optional isModified method used by storeEntity |
Constructor Summary | |
CMPClusteredInMemoryPersistenceManager()
|
Method Summary | |
void |
activateEntity(EntityEnterpriseContext (src) instance)
This method is called when an entity shall be activated. |
void |
create()
create the service, do expensive operations etc |
java.lang.Object |
createBeanClassInstance()
Returns a new instance of the bean class or a subclass of the bean class. |
java.lang.Object |
createEntity(java.lang.reflect.Method m,
java.lang.Object[] args,
EntityEnterpriseContext (src) ctx)
This method is called whenever an entity is to be created. |
void |
destroy()
destroy the service, tear down |
java.util.Collection |
findEntities(java.lang.reflect.Method finderMethod,
java.lang.Object[] args,
EntityEnterpriseContext (src) instance,
GenericEntityObjectFactory (src) factory)
This method is called when collections of entities are to be found. |
java.lang.Object |
findEntity(java.lang.reflect.Method finderMethod,
java.lang.Object[] args,
EntityEnterpriseContext (src) instance,
GenericEntityObjectFactory (src) factory)
This method is called when single entities are to be found. |
void |
initEntity(EntityEnterpriseContext (src) ctx)
Initializes the instance context. |
boolean |
isModified(EntityEnterpriseContext (src) ctx)
This method is used to determined whether the instance was modified. |
boolean |
isStoreRequired(EntityEnterpriseContext (src) ctx)
This method is used to determine if an entity should be stored. |
void |
loadEntity(EntityEnterpriseContext (src) ctx)
This method is called whenever an entity shall be load from the underlying storage. |
void |
passivateEntity(EntityEnterpriseContext (src) instance)
This method is called when an entity shall be passivate. |
java.lang.Object |
postCreateEntity(java.lang.reflect.Method m,
java.lang.Object[] args,
EntityEnterpriseContext (src) ctx)
This method is called after the ejbCreate. |
void |
removeEntity(EntityEnterpriseContext (src) ctx)
This method is called when an entity shall be removed from the underlying storage. |
void |
setContainer(Container (src) 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(EntityEnterpriseContext (src) ctx)
This method is called whenever an entity shall be stored to the underlying storage. |
protected void |
storeEntity(java.lang.Object id,
java.lang.Object obj)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EntityContainer (src) con
protected java.lang.reflect.Field idField
protected DistributedState (src) ds
protected java.lang.String DS_CATEGORY
protected java.lang.reflect.Method isModified
Constructor Detail |
public CMPClusteredInMemoryPersistenceManager()
Method Detail |
public void setContainer(Container (src) con)
setContainer
in interface ContainerPlugin (src)
con
- The container using this plugin.public void create() throws java.lang.Exception
create
in interface Service (src)
java.lang.Exception
public void start() throws java.lang.Exception
start
in interface Service (src)
java.lang.Exception
public void stop()
stop
in interface Service (src)
public void destroy()
destroy
in interface Service (src)
public java.lang.Object createBeanClassInstance() throws java.lang.Exception
createBeanClassInstance
in interface EntityPersistenceStore (src)
java.lang.Exception
public void initEntity(EntityEnterpriseContext (src) ctx)
This method is called before createEntity, and should reset the value of all cmpFields to 0 or null.
initEntity
in interface EntityPersistenceStore (src)
ctx
- public java.lang.Object createEntity(java.lang.reflect.Method m, java.lang.Object[] args, EntityEnterpriseContext (src) ctx) throws java.lang.Exception
createEntity
in interface EntityPersistenceStore (src)
m
- the create method in the home interface that was
calledargs
- any create parametersctx
- the instance ctx being used for this create call
java.lang.Exception
public java.lang.Object postCreateEntity(java.lang.reflect.Method m, java.lang.Object[] args, EntityEnterpriseContext (src) ctx) throws java.lang.Exception
postCreateEntity
in interface EntityPersistenceStore (src)
m
- the ejbPostCreate method in the bean class that was
calledargs
- any create parametersctx
- the instance being used for this create call
java.lang.Exception
public java.lang.Object findEntity(java.lang.reflect.Method finderMethod, java.lang.Object[] args, EntityEnterpriseContext (src) instance, GenericEntityObjectFactory (src) factory) throws java.lang.Exception
findEntity
in interface EntityPersistenceStore (src)
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersinstance
- the instance to use for the finder call
java.rmi.RemoteException
- thrown if some system exception occurs
FinderException (src)
- thrown if some heuristic problem occurs
java.lang.Exception
- thrown if some heuristic problem occurspublic java.util.Collection findEntities(java.lang.reflect.Method finderMethod, java.lang.Object[] args, EntityEnterpriseContext (src) instance, GenericEntityObjectFactory (src) factory) throws java.lang.Exception
findEntities
in interface EntityPersistenceStore (src)
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersinstance
- the instance to use for the finder call
java.rmi.RemoteException
- thrown if some system exception occurs
FinderException (src)
- thrown if some heuristic problem occurs
java.lang.Exception
- thrown if some heuristic problem occurspublic void activateEntity(EntityEnterpriseContext (src) 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 EntityPersistenceStore (src)
instance
- the instance to use for the activation
java.rmi.RemoteException
- thrown if some system exception occurspublic void loadEntity(EntityEnterpriseContext (src) ctx)
loadEntity
in interface EntityPersistenceStore (src)
ctx
- the instance to synchronize
java.rmi.RemoteException
- thrown if some system exception occurspublic boolean isStoreRequired(EntityEnterpriseContext (src) ctx) throws java.lang.Exception
isStoreRequired
in interface EntityPersistenceStore (src)
ctx
- the instance to check
java.lang.Exception
- thrown if some system exception occurspublic boolean isModified(EntityEnterpriseContext (src) ctx) throws java.lang.Exception
EntityPersistenceStore (src)
isModified
in interface EntityPersistenceStore (src)
ctx
-
java.lang.Exception
public void storeEntity(EntityEnterpriseContext (src) ctx) throws java.rmi.RemoteException
storeEntity
in interface EntityPersistenceStore (src)
ctx
- the instance to synchronize
java.rmi.RemoteException
- thrown if some system exception occurspublic void passivateEntity(EntityEnterpriseContext (src) instance)
See the activate discussion for the reason for exposing EJB callback calls to the store.
passivateEntity
in interface EntityPersistenceStore (src)
instance
- the instance to passivate
java.rmi.RemoteException
- thrown if some system exception occurspublic void removeEntity(EntityEnterpriseContext (src) ctx) throws RemoveException (src)
removeEntity
in interface EntityPersistenceStore (src)
ctx
- the instance to remove
java.rmi.RemoteException
- thrown if some system exception occurs
RemoveException (src)
- thrown if the instance could not be removedprotected void storeEntity(java.lang.Object id, java.lang.Object obj) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |