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:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, EjbModuleMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean

public class EjbModule
extends 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: 81030 $
Author:
Rickard Oberg, David Jencks, Francisco Reverbel, Adrian.Brock, Scott Stark, Anil Saldhana
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 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(DeploymentInfo di, TransactionManager tm, ObjectName webServiceName)
          Deprecated. DeploymentInfo is obsolete
EjbModule(org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit unit, org.jboss.metadata.ApplicationMetaData metaData)
           
 
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()
           
 EJBTimerService getTimerService()
           
 URL getURL()
          Get the URL from which this deployment unit was deployed
 ObjectName getWebServiceName()
           
 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
 void setPolicyRegistration(org.jboss.security.authorization.PolicyRegistration policyRegistration)
           
 void setSecurityManagement(ISecurityManagement sm)
           
 void setTimerService(EJBTimerService timerService)
           
 void setTransactionManagerFactory(org.jboss.tm.TransactionManagerFactory tm)
           
 void setWebServiceName(ObjectName webServiceName)
           
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, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
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 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.deployers.vfs.spi.structure.VFSDeploymentUnit unit,
                 org.jboss.metadata.ApplicationMetaData metaData)

EjbModule

@Deprecated
public EjbModule(DeploymentInfo di,
                            TransactionManager tm,
                            ObjectName webServiceName)
Deprecated. DeploymentInfo is obsolete

Method Detail

setTransactionManagerFactory

public void setTransactionManagerFactory(org.jboss.tm.TransactionManagerFactory tm)
Specified by:
setTransactionManagerFactory in interface EjbModuleMBean

setSecurityManagement

public void setSecurityManagement(ISecurityManagement sm)
Specified by:
setSecurityManagement in interface EjbModuleMBean

setPolicyRegistration

public void setPolicyRegistration(org.jboss.security.authorization.PolicyRegistration policyRegistration)
Specified by:
setPolicyRegistration in interface EjbModuleMBean

getTimerService

public EJBTimerService getTimerService()
Specified by:
getTimerService in interface EjbModuleMBean

setTimerService

public void setTimerService(EJBTimerService timerService)
Specified by:
setTimerService in interface EjbModuleMBean

getWebServiceName

public ObjectName getWebServiceName()
Specified by:
getWebServiceName in interface EjbModuleMBean

setWebServiceName

public void setWebServiceName(ObjectName webServiceName)
Specified by:
setWebServiceName in interface EjbModuleMBean

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

Parameters:
cl -

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 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 ServiceMBeanSupport
Throws:
Exception - if an error occurs

stopService

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

Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

destroyService

protected void destroyService()
                       throws Exception
Overrides:
destroyService in class ServiceMBeanSupport
Throws:
Exception


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.