|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager
JDBCStoreManager manages storage of persistence data into a table. Other then loading the initial jbosscmp-jdbc.xml file this class does very little. The interesting tasks are performed by the command classes. Life-cycle: Tied to the life-cycle of the entity container. Multiplicity: One per cmp entity bean. This could be less if another implementaion of EntityPersistenceStore is created and thoes beans use the implementation
EntityPersistenceStore
(src) Field Summary |
Constructor Summary | |
JDBCStoreManager()
|
Method Summary | |
void |
activateEntity(EntityEnterpriseContext (src) ctx)
This method is called when an entity shall be activated. |
void |
create()
Does almost nothing because other services such as JDBC data sources may not have been started. |
java.lang.Object |
createBeanClassInstance()
Returns a new instance of a class which implemnts the bean class. |
java.lang.Object |
createEntity(java.lang.reflect.Method createMethod,
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) ctx,
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) ctx,
GenericEntityObjectFactory (src) factory)
This method is called when single entities are to be found. |
java.lang.Object |
getApplicationData(java.lang.Object key)
|
java.util.Map |
getApplicationDataMap()
|
java.lang.Object |
getApplicationTxData(java.lang.Object key)
|
Catalog (src) |
getCatalog()
|
JDBCCommandFactory (src) |
getCommandFactory()
|
EntityContainer (src) |
getContainer()
Gets the container for this entity. |
JDBCAbstractEntityBridge (src) |
getEntityBridge()
|
java.lang.Object |
getEntityTxData(java.lang.Object key)
|
JDBCTypeFactory (src) |
getJDBCTypeFactory()
|
JDBCEntityMetaData (src) |
getMetaData()
|
JDBCQueryManager (src) |
getQueryManager()
|
ReadAheadCache (src) |
getReadAheadCache()
|
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)
Loads entity. |
boolean |
loadEntity(EntityEnterpriseContext (src) ctx,
boolean failIfNotFound)
|
void |
loadField(JDBCCMPFieldBridge (src) field,
EntityEnterpriseContext (src) ctx)
|
java.util.Collection |
loadRelation(JDBCCMRFieldBridge (src) cmrField,
java.lang.Object pk)
|
void |
passivateEntity(EntityEnterpriseContext (src) ctx)
This method is called when an entity shall be passivate. |
java.lang.Object |
postCreateEntity(java.lang.reflect.Method createMethod,
java.lang.Object[] args,
EntityEnterpriseContext (src) ctx)
This method is called after the createEntity. |
void |
putApplicationData(java.lang.Object key,
java.lang.Object value)
|
void |
putApplicationTxData(java.lang.Object key,
java.lang.Object value)
|
void |
putEntityTxData(java.lang.Object key,
java.lang.Object value)
|
void |
removeEntity(EntityEnterpriseContext (src) ctx)
This method is called when an entity shall be removed from the underlying storage. |
void |
removeEntityTxData(java.lang.Object key)
|
void |
scheduleCascadeDelete(java.util.List pks)
Schedules instances for cascade-delete |
void |
setContainer(Container (src) container)
Sets the container for this entity. |
void |
start()
Bring the store to a fully initialized state |
void |
stop()
stop the service |
void |
storeEntity(EntityEnterpriseContext (src) ctx)
This method is called whenever an entity shall be stored to the underlying storage. |
boolean |
unscheduledCascadeDelete(java.lang.Object pk)
Unschedules instance cascade delete. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JDBCStoreManager()
Method Detail |
public EntityContainer (src) getContainer()
getContainer
in interface JDBCEntityPersistenceStore (src)
public void setContainer(Container (src) container)
setContainer
in interface ContainerPlugin (src)
container
- the container for this entity
java.lang.ClassCastException
- if the container is not an instance of
EntityContainerpublic JDBCAbstractEntityBridge (src) getEntityBridge()
getEntityBridge
in interface JDBCEntityPersistenceStore (src)
public JDBCTypeFactory (src) getJDBCTypeFactory()
getJDBCTypeFactory
in interface JDBCEntityPersistenceStore (src)
public JDBCEntityMetaData (src) getMetaData()
getMetaData
in interface JDBCEntityPersistenceStore (src)
public JDBCQueryManager (src) getQueryManager()
public JDBCCommandFactory (src) getCommandFactory()
public ReadAheadCache (src) getReadAheadCache()
public java.util.Map getApplicationDataMap()
public java.lang.Object getApplicationData(java.lang.Object key)
getApplicationData
in interface JDBCEntityPersistenceStore (src)
public void putApplicationData(java.lang.Object key, java.lang.Object value)
putApplicationData
in interface JDBCEntityPersistenceStore (src)
public void scheduleCascadeDelete(java.util.List pks)
public boolean unscheduledCascadeDelete(java.lang.Object pk)
pk
- instance primary key.
public java.lang.Object getApplicationTxData(java.lang.Object key)
public void putApplicationTxData(java.lang.Object key, java.lang.Object value)
public java.lang.Object getEntityTxData(java.lang.Object key)
public void putEntityTxData(java.lang.Object key, java.lang.Object value)
public void removeEntityTxData(java.lang.Object key)
public Catalog (src) getCatalog()
getCatalog
in interface JDBCEntityPersistenceStore (src)
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()
Service (src)
stop
in interface Service (src)
public void destroy()
Service (src)
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)
EntityPersistenceStore (src)
This method is called before createEntity, and should resetStats the value of all cmpFields to 0 or null.
initEntity
in interface EntityPersistenceStore (src)
ctx
- public java.lang.Object createEntity(java.lang.reflect.Method createMethod, java.lang.Object[] args, EntityEnterpriseContext (src) ctx) throws CreateException (src)
EntityPersistenceStore (src)
createEntity
in interface EntityPersistenceStore (src)
createMethod
- the create method in the home interface that was
calledargs
- any create parametersctx
- the instance being used for this create call
CreateException (src)
public java.lang.Object postCreateEntity(java.lang.reflect.Method createMethod, java.lang.Object[] args, EntityEnterpriseContext (src) ctx)
EntityPersistenceStore (src)
postCreateEntity
in interface EntityPersistenceStore (src)
createMethod
- the ejbPostCreate method in the bean class that was
calledargs
- any create parametersctx
- the instance being used for this create call
public java.lang.Object findEntity(java.lang.reflect.Method finderMethod, java.lang.Object[] args, EntityEnterpriseContext (src) ctx, GenericEntityObjectFactory (src) factory) throws FinderException (src)
EntityPersistenceStore (src)
findEntity
in interface EntityPersistenceStore (src)
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersctx
- the instance to use for the finder call
FinderException (src)
public java.util.Collection findEntities(java.lang.reflect.Method finderMethod, java.lang.Object[] args, EntityEnterpriseContext (src) ctx, GenericEntityObjectFactory (src) factory) throws FinderException (src)
EntityPersistenceStore (src)
findEntities
in interface EntityPersistenceStore (src)
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersctx
- the instance to use for the finder call
FinderException (src)
public void activateEntity(EntityEnterpriseContext (src) ctx)
EntityPersistenceStore (src)
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)
ctx
- the instance to use for the activationpublic void loadEntity(EntityEnterpriseContext (src) ctx)
loadEntity
in interface EntityPersistenceStore (src)
ctx
- - entity context.public boolean loadEntity(EntityEnterpriseContext (src) ctx, boolean failIfNotFound)
public void loadField(JDBCCMPFieldBridge (src) field, EntityEnterpriseContext (src) ctx)
public boolean isStoreRequired(EntityEnterpriseContext (src) ctx)
EntityPersistenceStore (src)
isStoreRequired
in interface EntityPersistenceStore (src)
ctx
- the instance to check
public boolean isModified(EntityEnterpriseContext (src) ctx)
EntityPersistenceStore (src)
isModified
in interface EntityPersistenceStore (src)
ctx
-
public void storeEntity(EntityEnterpriseContext (src) ctx)
EntityPersistenceStore (src)
storeEntity
in interface EntityPersistenceStore (src)
ctx
- the instance to synchronizepublic void passivateEntity(EntityEnterpriseContext (src) ctx)
EntityPersistenceStore (src)
See the activate discussion for the reason for exposing EJB callback calls to the store.
passivateEntity
in interface EntityPersistenceStore (src)
ctx
- the instance to passivatepublic void removeEntity(EntityEnterpriseContext (src) ctx) throws RemoveException (src) , java.rmi.RemoteException
EntityPersistenceStore (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 removedpublic java.util.Collection loadRelation(JDBCCMRFieldBridge (src) cmrField, java.lang.Object pk)
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |