org.openejb.core.stateful
Class StatefulContainer
java.lang.Object
|
+--org.openejb.core.stateful.StatefulContainer
- All Implemented Interfaces:
- Container, RpcContainer, TransactionContainer
- public class StatefulContainer
- extends java.lang.Object
- implements RpcContainer, TransactionContainer
Stateful SessionBean container
- Version:
- $Revision: 1.2 $ $Date: 2002/02/25 20:31:00 $
Method Summary |
protected ProxyInfo |
createEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
|
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)
|
java.lang.Object |
getContainerID()
Gets the id of this container. |
int |
getContainerType()
Gets the type of container (STATELESS, STATEFUL, ENTITY, or MESSAGE_DRIVEN |
DeploymentInfo |
getDeploymentInfo(java.lang.Object deploymentID)
Gets the DeploymentInfo object for the bean with the specified deployment id. |
StatefulInstanceManager |
getInstanceManager()
|
void |
init(java.lang.Object id,
java.util.HashMap registry,
java.util.Properties properties)
This method is used to initalized a new container with its name, deployments and properties. |
protected java.lang.Object |
invoke(java.lang.reflect.Method callMethod,
java.lang.reflect.Method runMethod,
java.lang.Object[] args,
javax.ejb.EnterpriseBean bean,
ThreadContext callContext)
|
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. |
protected java.lang.Object |
newPrimaryKey()
|
protected void |
removeEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
instanceManager
StatefulInstanceManager instanceManager
deploymentRegistry
java.util.HashMap deploymentRegistry
containerID
java.lang.Object containerID
EJB_REMOVE_METHOD
java.lang.reflect.Method EJB_REMOVE_METHOD
keyCount
long keyCount
StatefulContainer
public StatefulContainer()
init
public void init(java.lang.Object id,
java.util.HashMap registry,
java.util.Properties properties)
throws OpenEJBException
- Description copied from interface:
Container
- This method is used to initalized a new container with its name, deployments and properties.
this method is invoked by the assembler and will throw an exception if invoked after
the container is assembled.
- Specified by:
init
in interface Container
deployments
public DeploymentInfo[] deployments()
- Gets the
DeploymentInfo
objects for all the beans deployed in this container.
- Specified by:
deployments
in interface Container
- Returns:
- an array of DeploymentInfo objects
- See Also:
DeploymentInfo
,
ContainerSystem.deployments()
getDeploymentInfo
public DeploymentInfo getDeploymentInfo(java.lang.Object deploymentID)
- Gets the
DeploymentInfo
object for the bean with the specified deployment id.
- Specified by:
getDeploymentInfo
in interface Container
- Parameters:
id
- the deployment id of the deployed bean.- Returns:
- the DeploymentInfo object associated with the bean.
- See Also:
DeploymentInfo
,
ContainerSystem.getDeploymentInfo
,
DeploymentInfo.getDeploymentID()
getContainerType
public int getContainerType()
- Gets the type of container (STATELESS, STATEFUL, ENTITY, or MESSAGE_DRIVEN
- Specified by:
getContainerType
in interface Container
- Returns:
- id type bean container
getContainerID
public java.lang.Object getContainerID()
- Gets the id of this container.
- Specified by:
getContainerID
in interface Container
- Returns:
- the id of this container.
- See Also:
DeploymentInfo.getContainerID()
deploy
public void deploy(java.lang.Object deploymentID,
DeploymentInfo info)
throws OpenEJBException
- Adds a bean to this container.
- Specified by:
deploy
in interface Container
- Parameters:
deploymentId
- the deployment id of the bean to deploy.info
- the DeploymentInfo object associated with the bean.- Throws:
OpenEJBException
- Occurs when the container is not able to deploy the bean for some
reason.
invoke
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
- Invokes a method on an instance of the specified bean deployment.
- Specified by:
invoke
in interface RpcContainer
- Parameters:
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 keyprncpl
- - Returns:
- the result of invoking the specified method on the bean instance
- Throws:
OpenEJBException
- - See Also:
Container.invoke
,
StatelessContainer.invoke
invoke
protected java.lang.Object invoke(java.lang.reflect.Method callMethod,
java.lang.reflect.Method runMethod,
java.lang.Object[] args,
javax.ejb.EnterpriseBean bean,
ThreadContext callContext)
throws OpenEJBException
getInstanceManager
public StatefulInstanceManager getInstanceManager()
removeEJBObject
protected void removeEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
throws OpenEJBException
createEJBObject
protected ProxyInfo createEJBObject(java.lang.reflect.Method callMethod,
java.lang.Object[] args,
ThreadContext callContext)
throws OpenEJBException
newPrimaryKey
protected java.lang.Object newPrimaryKey()
discardInstance
public void discardInstance(javax.ejb.EnterpriseBean bean,
ThreadContext threadContext)
- Specified by:
discardInstance
in interface TransactionContainer