org.jboss.ejb3
Class Ejb3Deployment

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.ejb3.Ejb3Deployment
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, Ejb3DeploymentMBean, JavaEEModule, org.jboss.kernel.spi.dependency.KernelControllerContextAware, org.jboss.system.Service, org.jboss.system.ServiceMBean

public abstract class Ejb3Deployment
extends org.jboss.system.ServiceMBeanSupport
implements JavaEEModule, Ejb3DeploymentMBean

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

Version:
$Revision: 88060 $
Author:
Bill Burke, adrian@jboss.org

Field Summary
static String ACTUAL_ENTITY_MANAGER_FACTORY_CONTEXT
           
protected  CacheFactoryRegistry cacheFactoryRegistry
           
protected  String defaultConsumerDomain
           
protected  String defaultMDBDomain
           
protected  String defaultServiceDomain
           
protected  String defaultSFSBDomain
           
protected  String defaultSLSBDomain
           
protected  DeploymentScope deploymentScope
           
protected  LinkedHashMap<ObjectName,Container> ejbContainers
           
protected  List<String> explicitEntityClasses
           
protected  boolean hasEntities
           
protected  InitialContext initialContext
           
protected  KernelAbstraction kernelAbstraction
           
static String MANAGED_ENTITY_FACTORY_CONTEXT
           
protected  MBeanServer mbeanServer
           
protected  ObjectName objectName
           
protected  PersistenceManagerFactoryRegistry persistenceManagerFactoryRegistry
           
protected  PoolFactoryRegistry poolFactoryRegistry
           
protected  boolean reinitialize
           
protected  DeploymentUnit unit
           
 
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
Ejb3Deployment(org.jboss.deployers.structure.spi.DeploymentUnit deploymentUnit, DeploymentUnit unit, DeploymentScope deploymentScope, org.jboss.metadata.ejb.jboss.JBossMetaData metaData)
          Do not deploy persistence unit anymore.
 
Method Summary
 void create()
          Create all EJB containers and Persistence Units The only things that should be initialized is metadata that does not need access to any other deployment.
abstract  DependencyPolicy createDependencyPolicy(JavaEEComponent component)
           
protected abstract  javax.security.jacc.PolicyConfiguration createPolicyConfiguration()
           
protected  void deploy()
           
protected  void deployBeansFromLib(InitialContext ctx)
           
protected  void deployElement(Ejb3HandlerFactory factory, javassist.bytecode.ClassFile cf, InitialContext ctx)
           
protected  void deployElement(InputStream stream, Ejb3HandlerFactory factory, InitialContext ctx)
           
protected  void deployUrl(Ejb3HandlerFactory factory)
           
 void destroy()
           
 JavaEEApplication getApplication()
           
 CacheFactoryRegistry getCacheFactoryRegistry()
           
 Container getContainer(ObjectName name)
           
 String getDefaultConsumerDomain()
           
 String getDefaultMDBDomain()
           
 String getDefaultServiceDomain()
           
 String getDefaultSFSBDomain()
           
 String getDefaultSLSBDomain()
           
 DeploymentUnit getDeploymentUnit()
           
 DeploymentScope getEar()
           
 EJBContainer getEjbContainer(Class businessIntf)
           
 EJBContainer getEjbContainer(String ejbLink, Class businessIntf)
           
 EJBContainer getEjbContainerForEjbName(String ejbName)
          Get the deployment ejb container for the given ejb name.
 Map getEjbContainers()
           
 String getEjbJndiName(Class businessIntf)
           
 String getEjbJndiName(String ejbLink, Class businessIntf)
           
protected
<B extends org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData>
B
getEnterpriseBeanMetaData(String ejbName, Class<B> enterpriseBeanMetaDataClass)
          Do not call, for use in Ejb3Handler.
protected  Collection<InjectionHandler<org.jboss.metadata.javaee.spec.Environment>> getHandlers()
          Return the container injection handler collection.
protected  String getJaccContextId()
           
 KernelAbstraction getKernelAbstraction()
           
 MBeanServer getMbeanServer()
           
 org.jboss.metadata.ejb.jboss.JBossMetaData getMetaData()
          Get the meta data associated with this deployment or null if none.
 String getName()
           
 PersistenceManagerFactoryRegistry getPersistenceManagerFactoryRegistry()
           
 List<?> getPersistenceUnitDeployments()
          Deprecated. 
 PoolFactoryRegistry getPoolFactoryRegistry()
           
 RemoteProxyFactoryRegistry getRemoteProxyFactoryRegistry()
          Deprecated. 
protected  void processEJBContainerMetadata(Container container)
           
protected abstract  void putJaccInService(javax.security.jacc.PolicyConfiguration pc, DeploymentUnit unit)
           
protected  void registerDeployment()
           
protected  void registerEJBContainer(Container container)
           
protected  void reinitialize()
           
 String resolveMessageDestination(String link)
           
protected  String resolvePersistenceUnitSupplier(String persistenceUnitName)
           
 void setCacheFactoryRegistry(CacheFactoryRegistry registry)
           
 void setDefaultMDBDomain(String defaultMDBDomain)
          The default AOP domain for message driven beans.
 void setDefaultServiceDomain(String defaultServiceDomain)
          default AOP domain for service beans.
 void setDefaultSFSBDomain(String defaultSFSBDomain)
          The default stateful session bean aspect domain
 void setDefaultSLSBDomain(String defaultSLSBDomain)
          The default AOP domain for stateless session beans
 void setMbeanServer(MBeanServer mbeanServer)
           
 void setMessageDestinationReferenceResolver(MessageDestinationReferenceResolver resolver)
           
 void setPersistenceManagerFactoryRegistry(PersistenceManagerFactoryRegistry registry)
           
 void setPersistenceUnitDependencyResolver(org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver resolver)
           
 void setPoolFactoryRegistry(PoolFactoryRegistry poolFactoryRegistry)
           
 void setProcessPersistenceUnits(boolean b)
          Deprecated. processing persistence units is no longer supported, use jpa-deployers
 void setRemoteProxyFactoryRegistry(RemoteProxyFactoryRegistry registry)
          Deprecated. 
 void start()
           
 void stop()
           
protected  void unregisterDeployment()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
createService, destroyService, getDeploymentInfo, getLog, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, startService, stopService, 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
getState, getStateString, jbossInternalLifecycle
 

Field Detail

ACTUAL_ENTITY_MANAGER_FACTORY_CONTEXT

public static final String ACTUAL_ENTITY_MANAGER_FACTORY_CONTEXT
See Also:
Constant Field Values

MANAGED_ENTITY_FACTORY_CONTEXT

public static final String MANAGED_ENTITY_FACTORY_CONTEXT
See Also:
Constant Field Values

unit

protected DeploymentUnit unit

ejbContainers

protected LinkedHashMap<ObjectName,Container> ejbContainers

hasEntities

protected boolean hasEntities

explicitEntityClasses

protected List<String> explicitEntityClasses

defaultSLSBDomain

protected String defaultSLSBDomain

defaultSFSBDomain

protected String defaultSFSBDomain

defaultMDBDomain

protected String defaultMDBDomain

defaultConsumerDomain

protected String defaultConsumerDomain

defaultServiceDomain

protected String defaultServiceDomain

initialContext

protected InitialContext initialContext

kernelAbstraction

protected KernelAbstraction kernelAbstraction

mbeanServer

protected MBeanServer mbeanServer

deploymentScope

protected DeploymentScope deploymentScope

cacheFactoryRegistry

protected CacheFactoryRegistry cacheFactoryRegistry

persistenceManagerFactoryRegistry

protected PersistenceManagerFactoryRegistry persistenceManagerFactoryRegistry

poolFactoryRegistry

protected PoolFactoryRegistry poolFactoryRegistry

objectName

protected ObjectName objectName

reinitialize

protected boolean reinitialize
Constructor Detail

Ejb3Deployment

public Ejb3Deployment(org.jboss.deployers.structure.spi.DeploymentUnit deploymentUnit,
                      DeploymentUnit unit,
                      DeploymentScope deploymentScope,
                      org.jboss.metadata.ejb.jboss.JBossMetaData metaData)
Do not deploy persistence unit anymore.

Parameters:
deploymentUnit -
unit -
deploymentScope -
metaData -
Method Detail

getApplication

public JavaEEApplication getApplication()
Specified by:
getApplication in interface JavaEEModule

getEar

public DeploymentScope getEar()

getKernelAbstraction

public KernelAbstraction getKernelAbstraction()

getMbeanServer

public MBeanServer getMbeanServer()

setMbeanServer

public void setMbeanServer(MBeanServer mbeanServer)

getDeploymentUnit

public DeploymentUnit getDeploymentUnit()

getDefaultSLSBDomain

public String getDefaultSLSBDomain()

getCacheFactoryRegistry

public CacheFactoryRegistry getCacheFactoryRegistry()

setCacheFactoryRegistry

public void setCacheFactoryRegistry(CacheFactoryRegistry registry)

getRemoteProxyFactoryRegistry

@Deprecated
public RemoteProxyFactoryRegistry getRemoteProxyFactoryRegistry()
Deprecated. 


setRemoteProxyFactoryRegistry

@Deprecated
public void setRemoteProxyFactoryRegistry(RemoteProxyFactoryRegistry registry)
Deprecated. 


getPersistenceManagerFactoryRegistry

public PersistenceManagerFactoryRegistry getPersistenceManagerFactoryRegistry()

setMessageDestinationReferenceResolver

public void setMessageDestinationReferenceResolver(MessageDestinationReferenceResolver resolver)

setPersistenceManagerFactoryRegistry

public void setPersistenceManagerFactoryRegistry(PersistenceManagerFactoryRegistry registry)

setPersistenceUnitDependencyResolver

public void setPersistenceUnitDependencyResolver(org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver resolver)

getPoolFactoryRegistry

public PoolFactoryRegistry getPoolFactoryRegistry()

setPoolFactoryRegistry

public void setPoolFactoryRegistry(PoolFactoryRegistry poolFactoryRegistry)

setProcessPersistenceUnits

@Deprecated
public void setProcessPersistenceUnits(boolean b)
Deprecated. processing persistence units is no longer supported, use jpa-deployers

Parameters:
b -

setDefaultSLSBDomain

public void setDefaultSLSBDomain(String defaultSLSBDomain)
The default AOP domain for stateless session beans

Parameters:
defaultSLSBDomain -

getDefaultSFSBDomain

public String getDefaultSFSBDomain()

getDefaultConsumerDomain

public String getDefaultConsumerDomain()

setDefaultSFSBDomain

public void setDefaultSFSBDomain(String defaultSFSBDomain)
The default stateful session bean aspect domain

Parameters:
defaultSFSBDomain -

getDefaultMDBDomain

public String getDefaultMDBDomain()

setDefaultMDBDomain

public void setDefaultMDBDomain(String defaultMDBDomain)
The default AOP domain for message driven beans.

Parameters:
defaultMDBDomain -

getDefaultServiceDomain

public String getDefaultServiceDomain()

setDefaultServiceDomain

public void setDefaultServiceDomain(String defaultServiceDomain)
default AOP domain for service beans.

Parameters:
defaultServiceDomain -

getJaccContextId

protected String getJaccContextId()

getEjbContainerForEjbName

public EJBContainer getEjbContainerForEjbName(String ejbName)
Get the deployment ejb container for the given ejb name.

Parameters:
ejbName - the deployment unique ejb name
Returns:
the ejb container if found, null otherwise
Throws:
IllegalStateException - if the ejbName cannot be used to for the container name.

getContainer

public Container getContainer(ObjectName name)
Specified by:
getContainer in interface Ejb3DeploymentMBean

getEjbContainers

public Map getEjbContainers()

getPersistenceUnitDeployments

@Deprecated
public List<?> getPersistenceUnitDeployments()
Deprecated. 


getEjbContainer

public EJBContainer getEjbContainer(String ejbLink,
                                    Class businessIntf)

getEjbJndiName

public String getEjbJndiName(String ejbLink,
                             Class businessIntf)

getEjbJndiName

public String getEjbJndiName(Class businessIntf)
                      throws NameNotFoundException
Throws:
NameNotFoundException

getEjbContainer

public EJBContainer getEjbContainer(Class businessIntf)
                             throws NameNotFoundException
Throws:
NameNotFoundException

processEJBContainerMetadata

protected void processEJBContainerMetadata(Container container)
                                    throws Exception
Throws:
Exception

registerDeployment

protected void registerDeployment()
                           throws Exception
Throws:
Exception

unregisterDeployment

protected void unregisterDeployment()

registerEJBContainer

protected void registerEJBContainer(Container container)
                             throws Exception
Throws:
Exception

createPolicyConfiguration

protected abstract javax.security.jacc.PolicyConfiguration createPolicyConfiguration()
                                                                              throws Exception
Throws:
Exception

putJaccInService

protected abstract void putJaccInService(javax.security.jacc.PolicyConfiguration pc,
                                         DeploymentUnit unit)

getHandlers

protected Collection<InjectionHandler<org.jboss.metadata.javaee.spec.Environment>> getHandlers()
Return the container injection handler collection. If not specified(null) a default handler collection will be created.

Returns:
the injection handler collection to use, null if the container should use a default setup.

create

public void create()
            throws Exception
Create all EJB containers and Persistence Units The only things that should be initialized is metadata that does not need access to any other deployment. This is because we want the entire EAR to be initialized so that we do not have to guess on dependencies MBean names. This is because of the silly scoping rules for persistence units and EJBs.

Specified by:
create in interface org.jboss.system.Service
Overrides:
create in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

reinitialize

protected void reinitialize()
                     throws Exception
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface org.jboss.system.Service
Overrides:
start in class org.jboss.system.ServiceMBeanSupport
Throws:
Exception

stop

public void stop()
Specified by:
stop in interface org.jboss.system.Service
Overrides:
stop in class org.jboss.system.ServiceMBeanSupport

deploy

protected void deploy()
               throws Exception
Throws:
Exception

deployUrl

protected void deployUrl(Ejb3HandlerFactory factory)
                  throws Exception
Throws:
Exception

deployElement

protected void deployElement(InputStream stream,
                             Ejb3HandlerFactory factory,
                             InitialContext ctx)
                      throws Exception
Throws:
Exception

deployBeansFromLib

protected void deployBeansFromLib(InitialContext ctx)
                           throws Exception
Throws:
Exception

deployElement

protected void deployElement(Ejb3HandlerFactory factory,
                             javassist.bytecode.ClassFile cf,
                             InitialContext ctx)
                      throws Exception
Throws:
Exception

createDependencyPolicy

public abstract DependencyPolicy createDependencyPolicy(JavaEEComponent component)

destroy

public void destroy()
Specified by:
destroy in interface org.jboss.system.Service
Overrides:
destroy in class org.jboss.system.ServiceMBeanSupport

resolveMessageDestination

public String resolveMessageDestination(String link)

resolvePersistenceUnitSupplier

protected String resolvePersistenceUnitSupplier(String persistenceUnitName)

getEnterpriseBeanMetaData

protected <B extends org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData> B getEnterpriseBeanMetaData(String ejbName,
                                                                                                           Class<B> enterpriseBeanMetaDataClass)
Do not call, for use in Ejb3Handler.

Type Parameters:
B -
Parameters:
ejbName -
enterpriseBeanMetaDataClass -
Returns:

getMetaData

public org.jboss.metadata.ejb.jboss.JBossMetaData getMetaData()
Get the meta data associated with this deployment or null if none.

Returns:
meta data or null

getName

public String getName()
Specified by:
getName in interface JavaEEModule
Specified by:
getName in interface org.jboss.system.ServiceMBean
Overrides:
getName in class org.jboss.system.ServiceMBeanSupport


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