|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport org.jboss.ejb.plugins.CMPInMemoryPersistenceManager
EntityPersistenceStore implementation storing values in-memory for very efficient access.
Revisions:
28.12.2001 - Sacha Labourey:
25.05.2002 - Dain Sundstrom:
EntityPersistenceStore
,
CMPFilePersistenceManager
Field Summary | |
protected HashMap |
beans
|
protected EntityContainer |
con
|
protected Field |
idField
|
protected Method |
isModified
Optional isModified method used by storeEntity. |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ServiceMBean |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
CMPInMemoryPersistenceManager()
|
Method Summary | |
void |
activateEntity(EntityEnterpriseContext instance)
Non-operation. |
Object |
createBeanClassInstance()
Returns a new instance of the bean class or a subclass of the bean class. |
Object |
createEntity(Method m,
Object[] args,
EntityEnterpriseContext ctx)
This method is called whenever an entity is to be created. |
protected void |
createService()
create the service, do expensive operations etc |
Collection |
findEntities(Method finderMethod,
Object[] args,
EntityEnterpriseContext instance,
GenericEntityObjectFactory factory)
This method is called when collections of entities are to be found. |
Object |
findEntity(Method finderMethod,
Object[] args,
EntityEnterpriseContext instance,
GenericEntityObjectFactory factory)
This method is called when single entities are to be found. |
void |
initEntity(EntityEnterpriseContext ctx)
Initializes the instance context. |
boolean |
isModified(EntityEnterpriseContext ctx)
This method is used to determined whether the instance was modified. |
boolean |
isStoreRequired(EntityEnterpriseContext ctx)
This method is used to determine if an entity should be stored. |
void |
loadEntity(EntityEnterpriseContext ctx)
This method is called whenever an entity shall be load from the underlying storage. |
void |
passivateEntity(EntityEnterpriseContext instance)
Non-operation. |
Object |
postCreateEntity(Method m,
Object[] args,
EntityEnterpriseContext ctx)
This method is called after the createEntity. |
void |
removeEntity(EntityEnterpriseContext ctx)
This method is called when an entity shall be removed from the underlying storage. |
void |
setContainer(Container con)
This callback is set by the container so that the plugin may access it |
protected void |
stopService()
|
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)
|
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
create, destroy, destroyService, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jboss.system.Service |
create, destroy, start, stop |
Field Detail |
protected EntityContainer con
protected HashMap beans
protected Field idField
protected Method isModified
Constructor Detail |
public CMPInMemoryPersistenceManager()
Method Detail |
public void setContainer(Container con)
setContainer
in interface ContainerPlugin
con
- The container using this plugin.
ClassCastException
- Container is not a EntityContainer.protected void createService() throws Exception
Exception
protected void stopService() throws Exception
Exception
public Object createBeanClassInstance() throws Exception
createBeanClassInstance
in interface EntityPersistenceStore
Exception
public void initEntity(EntityEnterpriseContext ctx)
This method is called before createEntity, and should reset the value of all cmpFields to 0 or null.
initEntity
in interface EntityPersistenceStore
ctx
- public Object createEntity(Method m, Object[] args, EntityEnterpriseContext ctx) throws Exception
createEntity
in interface EntityPersistenceStore
m
- the create method in the home interface that was
calledargs
- any create parametersctx
- the instance being used for this create call
Exception
public Object postCreateEntity(Method m, Object[] args, EntityEnterpriseContext ctx) throws Exception
postCreateEntity
in interface 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, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception
findEntity
in interface EntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersinstance
- the instance to use for the finder call
Exception
- thrown if some heuristic problem occurspublic Collection findEntities(Method finderMethod, Object[] args, EntityEnterpriseContext instance, GenericEntityObjectFactory factory) throws Exception
findEntities
in interface EntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersinstance
- the instance to use for the finder call
Exception
- thrown if some heuristic problem occurspublic void activateEntity(EntityEnterpriseContext instance)
activateEntity
in interface EntityPersistenceStore
instance
- the instance to use for the activationpublic void loadEntity(EntityEnterpriseContext ctx)
loadEntity
in interface EntityPersistenceStore
ctx
- the instance to synchronizepublic boolean isStoreRequired(EntityEnterpriseContext ctx) throws Exception
isStoreRequired
in interface EntityPersistenceStore
ctx
- the instance to check
Exception
- thrown if some system exception occurspublic boolean isModified(EntityEnterpriseContext ctx) throws Exception
EntityPersistenceStore
isModified
in interface EntityPersistenceStore
ctx
-
Exception
public void storeEntity(EntityEnterpriseContext ctx)
storeEntity
in interface EntityPersistenceStore
ctx
- the instance to synchronizepublic void passivateEntity(EntityEnterpriseContext instance)
passivateEntity
in interface EntityPersistenceStore
instance
- the instance to passivatepublic void removeEntity(EntityEnterpriseContext ctx) throws javax.ejb.RemoveException
removeEntity
in interface EntityPersistenceStore
ctx
- the instance to remove
javax.ejb.RemoveException
- thrown if the instance could not be removedprotected void storeEntity(Object id, Object obj)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |