|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager
public final class 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
Field Summary |
---|
Constructor Summary | |
---|---|
JDBCStoreManager()
|
Method Summary | |
---|---|
void |
activateEntity(EntityEnterpriseContext 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. |
Object |
createBeanClassInstance()
Returns a new instance of a class which implemnts the bean class. |
Object |
createEntity(Method createMethod,
Object[] args,
EntityEnterpriseContext ctx)
This method is called whenever an entity is to be created. |
void |
destroy()
|
Collection |
findEntities(Method finderMethod,
Object[] args,
EntityEnterpriseContext ctx,
GenericEntityObjectFactory factory)
This method is called when collections of entities are to be found. |
Object |
findEntity(Method finderMethod,
Object[] args,
EntityEnterpriseContext ctx,
GenericEntityObjectFactory factory)
This method is called when single entities are to be found. |
Object |
getApplicationData(Object key)
|
Map |
getApplicationDataMap()
|
Object |
getApplicationTxData(Object key)
|
Catalog |
getCatalog()
|
JDBCCommandFactory |
getCommandFactory()
|
EntityContainer |
getContainer()
Gets the container for this entity. |
JDBCAbstractEntityBridge |
getEntityBridge()
|
Object |
getEntityTxData(Object key)
|
JDBCTypeFactory |
getJDBCTypeFactory()
|
JDBCEntityMetaData |
getMetaData()
|
JDBCQueryManager |
getQueryManager()
|
ReadAheadCache |
getReadAheadCache()
|
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)
Loads entity. |
boolean |
loadEntity(EntityEnterpriseContext ctx,
boolean failIfNotFound)
|
void |
loadField(JDBCCMPFieldBridge field,
EntityEnterpriseContext ctx)
|
Collection |
loadRelation(JDBCCMRFieldBridge cmrField,
Object pk)
|
void |
passivateEntity(EntityEnterpriseContext ctx)
This method is called when an entity shall be passivate. |
Object |
postCreateEntity(Method createMethod,
Object[] args,
EntityEnterpriseContext ctx)
This method is called after the createEntity. |
void |
putApplicationData(Object key,
Object value)
|
void |
putApplicationTxData(Object key,
Object value)
|
void |
putEntityTxData(Object key,
Object value)
|
void |
removeEntity(EntityEnterpriseContext ctx)
This method is called when an entity shall be removed from the underlying storage. |
void |
removeEntityTxData(Object key)
|
void |
scheduleCascadeDelete(List pks)
Schedules instances for cascade-delete |
void |
setContainer(Container container)
Sets the container for this entity. |
void |
start()
Bring the store to a fully initialized state |
void |
stop()
|
void |
storeEntity(EntityEnterpriseContext ctx)
This method is called whenever an entity shall be stored to the underlying storage. |
boolean |
unscheduledCascadeDelete(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 getContainer()
getContainer
in interface JDBCEntityPersistenceStore
public void setContainer(Container container)
setContainer
in interface ContainerPlugin
container
- the container for this entity
ClassCastException
- if the container is not an instance of
EntityContainerpublic JDBCAbstractEntityBridge getEntityBridge()
getEntityBridge
in interface JDBCEntityPersistenceStore
public JDBCTypeFactory getJDBCTypeFactory()
getJDBCTypeFactory
in interface JDBCEntityPersistenceStore
public JDBCEntityMetaData getMetaData()
getMetaData
in interface JDBCEntityPersistenceStore
public JDBCQueryManager getQueryManager()
public JDBCCommandFactory getCommandFactory()
public ReadAheadCache getReadAheadCache()
public Map getApplicationDataMap()
public Object getApplicationData(Object key)
getApplicationData
in interface JDBCEntityPersistenceStore
public void putApplicationData(Object key, Object value)
putApplicationData
in interface JDBCEntityPersistenceStore
public void scheduleCascadeDelete(List pks)
public boolean unscheduledCascadeDelete(Object pk)
pk
- instance primary key.
public Object getApplicationTxData(Object key)
public void putApplicationTxData(Object key, Object value)
public Object getEntityTxData(Object key)
public void putEntityTxData(Object key, Object value)
public void removeEntityTxData(Object key)
public Catalog getCatalog()
getCatalog
in interface JDBCEntityPersistenceStore
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 EntityPersistenceStore
Exception
public void initEntity(EntityEnterpriseContext ctx)
EntityPersistenceStore
This method is called before createEntity, and should resetStats the value of all cmpFields to 0 or null.
initEntity
in interface EntityPersistenceStore
public Object createEntity(Method createMethod, Object[] args, EntityEnterpriseContext ctx) throws javax.ejb.CreateException
EntityPersistenceStore
createEntity
in interface EntityPersistenceStore
createMethod
- the create method in the home interface that was
calledargs
- any create parametersctx
- the instance being used for this create call
javax.ejb.CreateException
public Object postCreateEntity(Method createMethod, Object[] args, EntityEnterpriseContext ctx)
EntityPersistenceStore
postCreateEntity
in interface EntityPersistenceStore
createMethod
- the ejbPostCreate method in the bean class that was
calledargs
- any create parametersctx
- the instance being used for this create call
public Object findEntity(Method finderMethod, Object[] args, EntityEnterpriseContext ctx, GenericEntityObjectFactory factory) throws javax.ejb.FinderException
EntityPersistenceStore
findEntity
in interface EntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersctx
- the instance to use for the finder call
javax.ejb.FinderException
public Collection findEntities(Method finderMethod, Object[] args, EntityEnterpriseContext ctx, GenericEntityObjectFactory factory) throws javax.ejb.FinderException
EntityPersistenceStore
findEntities
in interface EntityPersistenceStore
finderMethod
- the find method in the home interface that was
calledargs
- any finder parametersctx
- the instance to use for the finder call
javax.ejb.FinderException
public void activateEntity(EntityEnterpriseContext ctx)
EntityPersistenceStore
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
ctx
- the instance to use for the activationpublic void loadEntity(EntityEnterpriseContext ctx)
loadEntity
in interface EntityPersistenceStore
ctx
- - entity context.public boolean loadEntity(EntityEnterpriseContext ctx, boolean failIfNotFound)
public void loadField(JDBCCMPFieldBridge field, EntityEnterpriseContext ctx)
public boolean isStoreRequired(EntityEnterpriseContext ctx)
EntityPersistenceStore
isStoreRequired
in interface EntityPersistenceStore
ctx
- the instance to check
public boolean isModified(EntityEnterpriseContext ctx)
EntityPersistenceStore
isModified
in interface EntityPersistenceStore
public void storeEntity(EntityEnterpriseContext ctx)
EntityPersistenceStore
storeEntity
in interface EntityPersistenceStore
ctx
- the instance to synchronizepublic void passivateEntity(EntityEnterpriseContext ctx)
EntityPersistenceStore
See the activate discussion for the reason for exposing EJB callback calls to the store.
passivateEntity
in interface EntityPersistenceStore
ctx
- the instance to passivatepublic void removeEntity(EntityEnterpriseContext ctx) throws javax.ejb.RemoveException, RemoteException
EntityPersistenceStore
removeEntity
in interface EntityPersistenceStore
ctx
- the instance to remove
javax.ejb.RemoveException
- thrown if the instance could not be removed
RemoteException
- thrown if some system exception occurspublic Collection loadRelation(JDBCCMRFieldBridge cmrField, Object pk)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |