org.openejb.core.stateful
Class StatefulContainer

java.lang.Object
  extended by org.openejb.core.stateful.StatefulContainer
All Implemented Interfaces:
Container, TransactionContainer, RpcContainer

public class StatefulContainer
extends java.lang.Object
implements RpcContainer, TransactionContainer

Stateful SessionBean container

Version:
$Revision: 2495 $ $Date: 2006-02-22 23:30:53 -0800 (Wed, 22 Feb 2006) $
Author:
Richard Monson-Haefel, David Blevins

Field Summary
protected static Logger logger
           
 
Fields inherited from interface org.openejb.Container
ENTITY, MESSAGE_DRIVEN, STATEFUL, STATELESS
 
Constructor Summary
StatefulContainer()
           
 
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
 

Field Detail

logger

protected static final Logger logger
Constructor Detail

StatefulContainer

public StatefulContainer()
Method Detail

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
Throws:
OpenEJBException

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

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:
deploymentID - the deployment id of the deployed bean.
Returns:
the DeploymentInfo object associated with the bean.
See Also:
DeploymentInfo, 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.

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. (processes all business methods on an remote interface)

Specified by:
invoke in interface RpcContainer
Parameters:
deployID - the dployment id of the bean deployment
callMethod - the method to be called on the bean instance
args - the arguments to use when invoking the specified method
primKey - the primary key class of the bean or null if the bean does not need a primary key
securityIdentity - identity
Returns:
the result of invoking the specified method on the bean instance
Throws:
OpenEJBException
See Also:
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
Throws:
OpenEJBException

getInstanceManager

public StatefulInstanceManager getInstanceManager()

removeEJBObject

protected void removeEJBObject(java.lang.reflect.Method callMethod,
                               java.lang.Object[] args,
                               ThreadContext callContext)
                        throws OpenEJBException
Throws:
OpenEJBException

createEJBObject

protected ProxyInfo createEJBObject(java.lang.reflect.Method callMethod,
                                    java.lang.Object[] args,
                                    ThreadContext callContext)
                             throws OpenEJBException
Throws:
OpenEJBException

newPrimaryKey

protected java.lang.Object newPrimaryKey()

discardInstance

public void discardInstance(javax.ejb.EnterpriseBean bean,
                            ThreadContext threadContext)
Specified by:
discardInstance in interface TransactionContainer


Copyright © 1999-2011 OpenEJB. All Rights Reserved.