|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openejb.alt.containers.castor_cmp11.CastorCMP11_EntityContainer
public class CastorCMP11_EntityContainer
Container-Managed Persistence EntityBean container based on Castor
Nested Class Summary | |
---|---|
static class |
CastorCMP11_EntityContainer.Key
|
class |
CastorCMP11_EntityContainer.SynchronizationWrapper
|
Field Summary | |
---|---|
protected static java.lang.reflect.Method |
EJB_REMOVE_METHOD
|
protected java.lang.String |
Global_TX_Database
The name of the database.xml file that is used for global or container managed transactions. |
protected org.exolab.castor.jdo.JDO |
jdo_ForGlobalTransaction
This is a handle into a specific Castor JDO instance for a specific database mapping that has been configured to work with the transaciton manager. |
protected org.exolab.castor.jdo.JDO |
jdo_ForLocalTransaction
This is a handle into a specific Castor JDO instance for a specific database mapping that has been configured to manage its own transactions. |
protected java.lang.String |
Local_TX_Database
The name of the database.xml file that is used for local or unspecified transaction contexts. |
Logger |
logger
|
protected java.util.HashMap |
methodReadyPoolMap
|
protected static java.lang.Object[] |
noArgs
|
protected java.util.Hashtable |
pooledInstancesMap
|
protected int |
poolsize
|
protected java.util.Hashtable |
readyInstancesMap
|
protected java.util.HashMap |
resetMap
|
protected static java.lang.reflect.Method |
SET_ENTITY_CONTEXT_METHOD
|
protected java.util.Hashtable |
txReadyPoolMap
|
protected static java.lang.reflect.Method |
UNSET_ENTITY_CONTEXT_METHOD
|
Fields inherited from interface org.openejb.Container |
---|
ENTITY, MESSAGE_DRIVEN, STATEFUL, STATELESS |
Constructor Summary | |
---|---|
CastorCMP11_EntityContainer()
|
Method Summary | |
---|---|
protected java.lang.Object |
businessMethod(java.lang.reflect.Method callMethod,
java.lang.reflect.Method runMethod,
java.lang.Object[] args,
ThreadContext callContext)
Processes a business method invokation |
void |
created(java.lang.Object object)
Called to indicate that an object has been created. |
protected ProxyInfo |
createEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
This method is responsible for delegating the ejbCreate() and ejbPostCreate() methods on the an entity bean. |
void |
creating(java.lang.Object object,
org.exolab.castor.jdo.Database db)
Called to indicate that an object is to be created in persistent storage. |
void |
deploy(java.lang.Object deploymentID,
DeploymentInfo info)
Adds a bean to this container. |
DeploymentInfo[] |
deployments()
Gets the DeploymentInfo objects for all the beans deployed
in this container. |
void |
discardInstance(javax.ejb.EnterpriseBean bean,
ThreadContext threadContext)
Discards this instance so that it may be garbage collected |
protected javax.ejb.EntityBean |
fetchAndLoadBean(ThreadContext callContext,
org.exolab.castor.jdo.Database db)
This method is responsible for loading the bean from the database based on the primary key identity contained in the callContext parameter. |
javax.ejb.EntityBean |
fetchFreeInstance(ThreadContext callContext)
Obtains a bean instance from the method ready pool. |
protected java.lang.Object |
findEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
This method is used to execute the find methods which are considered global in scope. |
java.lang.Object |
getContainerID()
Gets the id of this container. |
int |
getContainerType()
Gets the type of container (STATELESS, STATEFUL, ENTITY, or MESSAGE_DRIVEN |
protected org.exolab.castor.jdo.Database |
getDatabase(ThreadContext callContext)
If their is no transaction the CastorTransactionScopeManager.begin() method would have set the unspecified value of the ThreadContext to a non-transaction managed database object. |
DeploymentInfo |
getDeploymentInfo(java.lang.Object deploymentID)
Gets the DeploymentInfo object for the bean with the
specified deployment id. |
void |
init(java.lang.Object id,
java.util.HashMap registry,
java.util.Properties properties)
Construct this container with the specified container id, deployments, container manager and properties. |
java.lang.Object |
invoke(java.lang.Object deployID,
java.lang.reflect.Method callMethod,
java.lang.Object[] args,
java.lang.Object primKey,
java.lang.Object securityIdentity)
Invokes a method on an instance of the specified bean deployment. |
java.lang.Class |
loaded(java.lang.Object loaded,
org.exolab.castor.mapping.AccessMode mode)
|
java.lang.Class |
loaded(java.lang.Object object,
short accessMode)
Called to indicate that the object has been loaded from persistent storage. |
java.lang.Object |
newInstance(java.lang.String className,
java.lang.ClassLoader loader)
Called to indicate that an object needs to be instatiated. |
protected void |
postInit()
I keep forgetting why I put this block outside the init method. |
void |
releasing(java.lang.Object object,
boolean committed)
Called to indicate that an object has been made transient. |
void |
removed(java.lang.Object object)
Called to indicate that an object has been deleted. |
protected void |
removeEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
Removes the EJBObject |
void |
removing(java.lang.Object object)
Called to indicate that an object is to be deleted. |
protected void |
resetBeanFields(java.lang.Object bean,
DeploymentInfo info)
Section 9.2.4 EJB 1.1: "The Container must ensure that the values of the container-managed fields are set to the Java language defaults (e.g. |
void |
storing(java.lang.Object object,
boolean modified)
Called to indicate that an object is to be stored in persistent storage. |
void |
updated(java.lang.Object object)
Called to indicate that an object has been updated at the end of a "long" transaction. |
void |
using(java.lang.Object object,
org.exolab.castor.jdo.Database db)
Called to indicate that an object has been made persistent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Hashtable txReadyPoolMap
protected java.util.Hashtable pooledInstancesMap
protected java.util.Hashtable readyInstancesMap
protected java.util.HashMap methodReadyPoolMap
protected int poolsize
protected static java.lang.reflect.Method SET_ENTITY_CONTEXT_METHOD
protected static java.lang.reflect.Method UNSET_ENTITY_CONTEXT_METHOD
protected static java.lang.reflect.Method EJB_REMOVE_METHOD
public Logger logger
protected java.lang.String Global_TX_Database
protected java.lang.String Local_TX_Database
protected org.exolab.castor.jdo.JDO jdo_ForGlobalTransaction
protected org.exolab.castor.jdo.JDO jdo_ForLocalTransaction
protected java.util.HashMap resetMap
protected static final java.lang.Object[] noArgs
Constructor Detail |
---|
public CastorCMP11_EntityContainer()
Method Detail |
---|
public void init(java.lang.Object id, java.util.HashMap registry, java.util.Properties properties) throws OpenEJBException
init
in interface Container
id
- the unique id to identify this container in the ContainerSystemregistry
- a hashMap of bean delpoyments that this container will be responsible forproperties
- the properties this container needs to initialize and run
OpenEJBException
- if there is a problem constructing the container
OpenEJBException
Container
protected void postInit()
public DeploymentInfo[] deployments()
DeploymentInfo
objects for all the beans deployed
in this container.
deployments
in interface Container
DeploymentInfo
,
Container.deployments()
public DeploymentInfo getDeploymentInfo(java.lang.Object deploymentID)
DeploymentInfo
object for the bean with the
specified deployment id.
getDeploymentInfo
in interface Container
deploymentID
-
DeploymentInfo
,
Container.getDeploymentInfo(Object)
,
DeploymentInfo.getDeploymentID()
public int getContainerType()
getContainerType
in interface Container
public java.lang.Object getContainerID()
getContainerID
in interface Container
Container.getContainerID()
public void deploy(java.lang.Object deploymentID, DeploymentInfo info) throws OpenEJBException
deploy
in interface Container
deploymentID
- the deployment id of the bean to deploy.info
- the DeploymentInfo object associated with the bean.
OpenEJBException
- Occurs when the container is not able to deploy the bean for some
reason.public java.lang.Object invoke(java.lang.Object deployID, java.lang.reflect.Method callMethod, java.lang.Object[] args, java.lang.Object primKey, java.lang.Object securityIdentity) throws OpenEJBException
invoke
in interface RpcContainer
deployID
- the dployment id of the bean deploymentcallMethod
- the method to be called on the bean instanceargs
- the arguments to use when invoking the specified methodprimKey
- the primary key class of the bean or null if the bean does not need a primary keysecurityIdentity
-
OpenEJBException
RpcContainer.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[], java.lang.Object, java.lang.Object)
,
StatefulContainer.invoke
public void discardInstance(javax.ejb.EnterpriseBean bean, ThreadContext threadContext)
discardInstance
in interface TransactionContainer
bean
- threadContext
- public javax.ejb.EntityBean fetchFreeInstance(ThreadContext callContext) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.InstantiationException
callContext
-
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException
java.lang.InstantiationException
protected java.lang.Object businessMethod(java.lang.reflect.Method callMethod, java.lang.reflect.Method runMethod, java.lang.Object[] args, ThreadContext callContext) throws OpenEJBException
callMethod
- runMethod
- args
- callContext
-
OpenEJBException
protected ProxyInfo createEJBObject(java.lang.reflect.Method callMethod, java.lang.Object[] args, ThreadContext callContext) throws OpenEJBException
callMethod
- args
- callContext
-
OpenEJBException
protected java.lang.Object findEJBObject(java.lang.reflect.Method callMethod, java.lang.Object[] args, ThreadContext callContext) throws OpenEJBException
callMethod
- args
- callContext
-
OpenEJBException
protected void removeEJBObject(java.lang.reflect.Method callMethod, java.lang.Object[] args, ThreadContext callContext) throws OpenEJBException
callMethod
- args
- callContext
-
OpenEJBException
protected javax.ejb.EntityBean fetchAndLoadBean(ThreadContext callContext, org.exolab.castor.jdo.Database db) throws org.exolab.castor.jdo.PersistenceException, org.exolab.castor.jdo.ObjectNotFoundException, org.exolab.castor.jdo.TransactionNotInProgressException, org.exolab.castor.jdo.LockNotGrantedException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
callContext
- db
-
org.exolab.castor.jdo.PersistenceException
org.exolab.castor.jdo.ObjectNotFoundException
org.exolab.castor.jdo.TransactionNotInProgressException
org.exolab.castor.jdo.LockNotGrantedException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
protected org.exolab.castor.jdo.Database getDatabase(ThreadContext callContext) throws org.exolab.castor.jdo.DatabaseNotFoundException, org.exolab.castor.jdo.PersistenceException, javax.transaction.SystemException
callContext
-
org.exolab.castor.jdo.DatabaseNotFoundException
org.exolab.castor.jdo.PersistenceException
javax.transaction.SystemException
protected void resetBeanFields(java.lang.Object bean, DeploymentInfo info)
public java.lang.Object newInstance(java.lang.String className, java.lang.ClassLoader loader)
The parameters are ignored. Data is obtained from the deployment info which has been obtained, in turn, from the current call context.
newInstance
in interface org.exolab.castor.persist.spi.InstanceFactory
className
- The name of the class of the object to be createdloader
- The class loader to use when creating the object
public java.lang.Class loaded(java.lang.Object object, short accessMode)
object
- The object
public void storing(java.lang.Object object, boolean modified)
storing
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectmodified
- Is the object modified?public void creating(java.lang.Object object, org.exolab.castor.jdo.Database db)
creating
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectdb
- The database in which this object will be createdpublic void created(java.lang.Object object)
created
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectpublic void removing(java.lang.Object object)
This method is made at commit time on objects deleted during the transaction before setting their fields to null.
removing
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectpublic void removed(java.lang.Object object)
This method is called during db.remove().
removed
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectpublic void releasing(java.lang.Object object, boolean committed)
This method is made at commit or rollback time on all objects that were presistent during the life time of the transaction.
releasing
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectcommitted
- True if the object has been commited, false
if rollback or otherwise cancelledpublic void using(java.lang.Object object, org.exolab.castor.jdo.Database db)
using
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectdb
- The database to which this object belongspublic void updated(java.lang.Object object)
updated
in interface org.exolab.castor.persist.spi.CallbackInterceptor
object
- The objectpublic java.lang.Class loaded(java.lang.Object loaded, org.exolab.castor.mapping.AccessMode mode) throws java.lang.Exception
loaded
in interface org.exolab.castor.persist.spi.CallbackInterceptor
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |