org.jboss.ejb
Class EjbModule

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.ejb.EjbModule
All Implemented Interfaces:
javax.management.MBeanRegistration, javax.management.NotificationBroadcaster, javax.management.NotificationEmitter, EjbModuleMBean, org.jboss.system.Service, org.jboss.system.ServiceMBean

public class EjbModule
extends org.jboss.system.ServiceMBeanSupport
implements EjbModuleMBean

An EjbModule represents a collection of beans that are deployed as a unit.

The beans may use the EjbModule to access other beans within the same deployment unit.

Version:
$Revision: 57281 $
Author:
Rickard Öberg, David Jencks, Francisco Reverbel, Adrian.Brock, Scott Stark
See Also:
Container, EJBDeployer

Field Summary
static int ANY
           
static String BASE_EJB_MODULE_NAME
           
static int BMT
           
static int CMT
           
static String DEFAULT_ENTITY_BMP_CONFIGURATION
           
static String DEFAULT_ENTITY_CMP_CONFIGURATION
           
static String DEFAULT_MESSAGEDRIVEN_CONFIGURATION
           
static String DEFAULT_STATEFUL_CONFIGURATION
           
static String DEFAULT_STATELESS_CONFIGURATION
           
static javax.management.ObjectName EJB_MODULE_QUERY_NAME
           
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
EjbModule(org.jboss.deployment.DeploymentInfo di, TransactionManager tm, javax.management.ObjectName webServiceName)
           
 
Method Summary
 void addLocalHome(Container con, javax.ejb.EJBLocalHome localHome)
           
protected  void createService()
           
protected  void destroyService()
           
 ClassLoader getClassLoader()
          Get the class loader of this deployment unit.
 Container getContainer(String name)
          Get a container from this deployment unit that corresponds to a given name
 Collection getContainers()
          Get all containers in this deployment unit.
 javax.ejb.EJBLocalHome getLocalHome(Container con)
           
 Object getModuleData(Object key)
           
 Map getModuleDataMap()
           
 URL getURL()
          Get the URL from which this deployment unit was deployed
 boolean isCallByValue()
          Whether the container is call by value
 void putModuleData(Object key, Object value)
           
 void removeContainer(Container con)
          Remove a container from this deployment unit.
 void removeLocalHome(Container con)
           
 void removeModuleData(Object key)
           
 void setClassLoader(ClassLoader cl)
          Set the class loader of this deployment unit
protected  void startService()
          The mbean Service interface start method calls the start method on each contatiner, then the init method on each container.
protected  void stopService()
          Stops all the containers of this application.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, destroy, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, stop
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

BASE_EJB_MODULE_NAME

public static final String BASE_EJB_MODULE_NAME
See Also:
Constant Field Values

EJB_MODULE_QUERY_NAME

public static final javax.management.ObjectName EJB_MODULE_QUERY_NAME

DEFAULT_STATELESS_CONFIGURATION

public static String DEFAULT_STATELESS_CONFIGURATION

DEFAULT_STATEFUL_CONFIGURATION

public static String DEFAULT_STATEFUL_CONFIGURATION

DEFAULT_ENTITY_BMP_CONFIGURATION

public static String DEFAULT_ENTITY_BMP_CONFIGURATION

DEFAULT_ENTITY_CMP_CONFIGURATION

public static String DEFAULT_ENTITY_CMP_CONFIGURATION

DEFAULT_MESSAGEDRIVEN_CONFIGURATION

public static String DEFAULT_MESSAGEDRIVEN_CONFIGURATION

BMT

public static final int BMT
See Also:
Constant Field Values

CMT

public static final int CMT
See Also:
Constant Field Values

ANY

public static final int ANY
See Also:
Constant Field Values
Constructor Detail

EjbModule

public EjbModule(org.jboss.deployment.DeploymentInfo di,
                 TransactionManager tm,
                 javax.management.ObjectName webServiceName)
Method Detail

getModuleDataMap

public Map getModuleDataMap()

getModuleData

public Object getModuleData(Object key)

putModuleData

public void putModuleData(Object key,
                          Object value)

removeModuleData

public void removeModuleData(Object key)

removeContainer

public void removeContainer(Container con)
Remove a container from this deployment unit.

Parameters:
con -

addLocalHome

public void addLocalHome(Container con,
                         javax.ejb.EJBLocalHome localHome)

removeLocalHome

public void removeLocalHome(Container con)

getLocalHome

public javax.ejb.EJBLocalHome getLocalHome(Container con)

isCallByValue

public boolean isCallByValue()
Whether the container is call by value

Returns:
true for call by value

getContainer

public Container getContainer(String name)
Get a container from this deployment unit that corresponds to a given name

Parameters:
name - ejb-name name defined in ejb-jar.xml
Returns:
container for the named bean, or null if the container was not found

getContainers

public Collection getContainers()
Get all containers in this deployment unit.

Specified by:
getContainers in interface EjbModuleMBean
Returns:
a collection of containers for each enterprise bean in this deployment unit.

getClassLoader

public ClassLoader getClassLoader()
Get the class loader of this deployment unit.

Returns:

setClassLoader

public void setClassLoader(ClassLoader cl)
Set the class loader of this deployment unit


getURL

public URL getURL()
Get the URL from which this deployment unit was deployed

Returns:
The URL from which this Application was deployed.

createService

protected void createService()
                      throws Exception
Overrides:
createService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

startService

protected void startService()
                     throws Exception
The mbean Service interface start method calls the start method on each contatiner, then the init method on each container. Conversion to a different registration system with one-phase startup is conceivable.

Overrides:
startService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception - if an error occurs

stopService

protected void stopService()
                    throws Exception
Stops all the containers of this application.

Overrides:
stopService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Overrides:
destroyService in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.