org.openejb
Interface Container

All Known Subinterfaces:
RpcContainer
All Known Implementing Classes:
CastorCMP11_EntityContainer, EntityContainer, RpcContainerWrapper, StatefulContainer, StatelessContainer, TomcatJndiSupport

public interface Container

The Container manages one or more bean deployments at runtime. There are two basic types of containers, the RPC container (org.openejb.RpcContainer) and the Java Message Service container (org.openejb.JmsContainer), both of which extend the base type org.openejb.Container.

The Container interface provides methods for accessing the Container's id, its ContainerManager, and the deployments managed by the container (represented by org.openejb.DeploymentInfo objects). In addition, the container defines the getContainerType() method, which will return Container.ENTITY, Container.STATEFUL, Container.STATELESS, or Container.MESSAGE_DRIVEN, depending on the bean type managed by the container.

Since:
JDK 1.2
Version:
0.1, 3/21/2000
Author:
Richard Monson-Haefel

Field Summary
static int ENTITY
           
static int MESSAGE_DRIVEN
           
static int STATEFUL
           
static int STATELESS
           
 
Method Summary
 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.
 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.
 void init(java.lang.Object containerId, java.util.HashMap deployments, java.util.Properties properties)
          This method is used to initalized a new container with its name, deployments and properties.
 

Field Detail

STATELESS

static final int STATELESS
See Also:
Constant Field Values

STATEFUL

static final int STATEFUL
See Also:
Constant Field Values

ENTITY

static final int ENTITY
See Also:
Constant Field Values

MESSAGE_DRIVEN

static final int MESSAGE_DRIVEN
See Also:
Constant Field Values
Method Detail

init

void init(java.lang.Object containerId,
          java.util.HashMap deployments,
          java.util.Properties properties)
          throws OpenEJBException
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.

Throws:
OpenEJBException

getContainerType

int getContainerType()
Gets the type of container (STATELESS, STATEFUL, ENTITY, or MESSAGE_DRIVEN

Returns:
id type bean container

getContainerID

java.lang.Object getContainerID()
Gets the id of this container.

Returns:
the id of this container.

getDeploymentInfo

DeploymentInfo getDeploymentInfo(java.lang.Object deploymentID)
Gets the DeploymentInfo object for the bean with the specified deployment id.

Parameters:
deploymentID - the deployment id of the deployed bean.
Returns:
the DeploymentInfo object associated with the bean.
See Also:
DeploymentInfo, DeploymentInfo.getDeploymentID()

deployments

DeploymentInfo[] deployments()
Gets the DeploymentInfo objects for all the beans deployed in this container.

Returns:
an array of DeploymentInfo objects
See Also:
DeploymentInfo

deploy

void deploy(java.lang.Object deploymentID,
            DeploymentInfo info)
            throws OpenEJBException
Adds a bean to this 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.


Copyright © 1999-2011 OpenEJB. All Rights Reserved.