org.jboss.ejb3
Class EJBContainer

java.lang.Object
  extended by org.jboss.ejb3.EJBContainer
All Implemented Interfaces:
Container, org.jboss.ejb3.context.spi.BeanManager, org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>, JavaEEComponent, EJBInjectionContainer, ExtendedInjectionContainer, InjectionContainer
Direct Known Subclasses:
TimerServiceContainer

public abstract class EJBContainer
extends java.lang.Object
implements Container, org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>, EJBInjectionContainer, ExtendedInjectionContainer, JavaEEComponent

Comment


Field Summary
protected  org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData assembly
           
protected  java.lang.String beanClassName
           
protected  java.lang.ClassLoader classloader
           
protected  java.lang.String ejbName
           
protected  javax.naming.Context enc
           
protected  EjbEncFactory encFactory
           
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.reflect.AccessibleObject,Injector>> encInjections
           
protected  java.util.Map<java.lang.String,EncInjector> encInjectors
           
static java.lang.String ENTITY_MANAGER_FACTORY
           
protected  java.util.Hashtable initialContextProperties
           
protected  java.util.List<Injector> injectors
           
protected  InvocationStatistics invokeStats
           
static java.lang.String MANAGED_ENTITY_MANAGER_FACTORY
           
protected  org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData metadataBasedAnnotationRepo
          Metadata based annotation repository
protected  javax.management.ObjectName objectName
           
protected  Pool pool
           
protected  boolean reinitialize
           
protected  org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData xml
           
 
Fields inherited from interface org.jboss.ejb3.Container
ENC_CTX_NAME
 
Constructor Summary
protected EJBContainer(java.lang.String name, org.jboss.aop.Domain domain, java.lang.ClassLoader cl, java.lang.String beanClassName, java.lang.String ejbName, java.util.Hashtable ctxProperties, Ejb3Deployment deployment, org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData beanMetaData)
           
protected EJBContainer(java.lang.String name, org.jboss.aop.Domain domain, java.lang.ClassLoader cl, java.lang.String beanClassName, java.lang.String ejbName, java.util.Hashtable ctxProperties, org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData beanMetaData)
          Create an EJBContainer
 
Method Summary
protected  void afterStart()
          Invoked after all the dependencies on the containers have satisfied and the container is completely started and open for invocations.
 boolean canResolveEJB()
          Deprecated. 
protected  void checkForDuplicateLocalAndRemoteInterfaces()
          Ensures that the bean does not implement any one interface as both @Local and @Remote EJBTHREE-1025
protected  java.lang.Object construct()
          Delegates bean instance construction to the beanInstantiator
 void create()
           
abstract  BeanContext<?> createBeanContext()
          Create a bean context for use in a pool.
 java.lang.Object createInterceptor(java.lang.Class<?> interceptorClass)
          Do not call, for BeanContainer.
 java.lang.String createObjectName(java.lang.String ejbName)
          Create an object name for the given EJB name in the same JavaEE module.
 java.lang.String createObjectName(java.lang.String unitName, java.lang.String ejbName)
          Create an object name for the given EJB name in another JavaEE module.
 void destroy()
           
 void destroyBeanContext(org.jboss.ejb3.interceptors.container.BeanContext<?> ctx)
          Do nothing.
protected  void findPartitionName()
           
 org.jboss.aop.Advisor getAdvisor()
          Deprecated. 
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType)
           
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType, java.lang.Class<?> clazz)
          If class has container overridable annotations, this method will discover those overriden annotations.
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType, java.lang.Class<?> clazz, java.lang.reflect.Field field)
          If class has container overridable annotations, this method will discover those overriden annotations.
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType, java.lang.Class<?> clazz, java.lang.reflect.Method method)
          If class has container overridable annotations, this method will discover those overriden annotations.
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType, java.lang.reflect.Field field)
           
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationType, java.lang.reflect.Method method)
           
 org.jboss.aop.annotation.AnnotationRepository getAnnotations()
          Deprecated. 
 javax.ejb.ApplicationException getApplicationException(java.lang.Class<?> exceptionType, java.lang.reflect.Method invokedMethod)
           
 org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData getAssemblyDescriptor()
           
 java.lang.Class<?> getBeanClass()
           
 java.lang.String getBeanClassName()
           
protected  BeanContainer getBeanContainer()
           
protected  org.jboss.ejb3.instantiator.spi.BeanInstantiator getBeanInstantiator()
           
 java.util.List<java.lang.Class<?>> getBusinessAndComponentInterfaces()
          Return all the business interfaces implemented by this bean.
<T> T
getBusinessObject(BeanContext<?> beanContext, java.lang.Class<T> businessInterface)
           
 org.jboss.jca.spi.ComponentStack getCachedConnectionManager()
           
 java.lang.ClassLoader getClassloader()
           
 java.lang.Class<?> getClazz()
          Deprecated. use getBeanClass
 DependencyPolicy getDependencyPolicy()
           
 Ejb3Deployment getDeployment()
           
 java.lang.String getDeploymentDescriptorType()
          For error messages
 java.lang.String getDeploymentPropertyListString()
          Returns a String identifier for this bean that is qualified by the deployment, and hence should be unique across deployments.
 java.lang.String getDeploymentQualifiedName()
           
 DeploymentUnit getDeploymentUnit()
           
protected  org.jboss.ejb3.effigy.EnterpriseBeanEffigy getEffigy()
           
static
<C extends EJBContainer>
C
getEJBContainer(org.jboss.aop.Advisor advisor)
           
 javax.ejb.EJBHome getEJBHome()
          
 java.lang.String getEjbJndiName(java.lang.Class businessInterface)
           
 java.lang.String getEjbJndiName(java.lang.String link, java.lang.Class businessInterface)
           
 javax.ejb.EJBLocalHome getEJBLocalHome()
          
 java.lang.String getEjbName()
           
 javax.naming.Context getEnc()
           
 java.util.Map<java.lang.String,java.util.Map<java.lang.reflect.AccessibleObject,Injector>> getEncInjections()
           
 java.util.Map<java.lang.String,EncInjector> getEncInjectors()
           
 org.jboss.metadata.javaee.spec.Environment getEnvironmentRefGroup()
           
protected  java.lang.Class[] getHandledCallbacks()
           
 java.lang.String getIdentifier()
          Some identifier that can be used in error messages
 javax.naming.InitialContext getInitialContext()
           
 java.util.Hashtable getInitialContextProperties()
           
protected  java.util.Collection<InjectionHandler<org.jboss.metadata.javaee.spec.Environment>> getInjectionHandlers()
           
 java.util.List<Injector> getInjectors()
           
 java.util.Collection<java.lang.Class<?>> getInterceptorClasses()
           
 java.util.Map<java.lang.Class<?>,InterceptorInjector> getInterceptorInjectors()
           
 InterceptorInfoRepository getInterceptorRepository()
           
protected  org.jboss.aop.advice.Interceptor[] getInterceptors(org.jboss.aop.joinpoint.Joinpoint joinPoint, java.lang.String interceptorStackName)
           
 java.util.concurrent.locks.Lock getInvocationLock()
           
 java.lang.Object getInvokedBusinessInterface(BeanContext beanContext)
           
protected  java.lang.Object getInvokedInterface(java.lang.reflect.Method method)
           
 InvocationStatistics getInvokeStats()
           
 java.lang.String getJaccContextId()
           
 org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData getMetaDataBasedAnnotationRepository()
          Returns AnnotationRepositoryToMetaData corresponding to this EJBContainer.
protected  org.jboss.aop.MethodInfo getMethodInfo(java.lang.reflect.Method method)
          Deprecated. 
 JavaEEModule getModule()
          Returns the module of which this component is a part.
 java.lang.String getName()
           
protected  java.lang.reflect.Method getNonBridgeMethod(java.lang.reflect.Method bridgeMethod)
           
 javax.management.ObjectName getObjectName()
           
 java.lang.String getPartitionName()
          Gets the name of the cluster partition with which this container is associated.
 Pool getPool()
           
 boolean getRollbackOnly()
          
 org.jboss.ejb3.vfs.spi.VirtualFile getRootFile()
           
<T> T
getSecurityManager(java.lang.Class<T> type)
          Get the security manager associated with a container.
protected  java.lang.reflect.Method getTimeoutCallback(org.jboss.metadata.ejb.spec.NamedMethodMetaData timeoutMethodMetaData, java.lang.Class<?> beanClass)
           
 javax.transaction.UserTransaction getUserTransaction()
          
 java.util.List<java.lang.reflect.Method> getVirtualMethods()
          Do not call, used by BeanContainer.
 org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData getXml()
           
abstract  boolean hasJNDIBinding(java.lang.String jndiName)
           
protected  void initializePool()
           
protected  void initMetaDataBasedAnnotationRepository()
          Initializes the metadata based annotation repository AnnotationRepositoryToMetaData, by setting up the appropriate metadata bridges.
 void injectBeanContext(BeanContext<?> beanContext)
          Note this method is a WIP.
 void instantiated()
          After XML processing has been done this allows the container to further initialize the meta data.
protected  void invokeCallback(BeanContext<?> beanContext, java.lang.Class<? extends java.lang.annotation.Annotation> callbackAnnotationClass)
          Note that this method is a WIP.
 void invokePostActivate(BeanContext beanContext)
           
 void invokePostConstruct(BeanContext<?> beanContext)
           
 void invokePostConstruct(BeanContext beanContext, java.lang.Object[] params)
          Deprecated. 
 void invokePreDestroy(BeanContext beanContext)
           
 void invokePrePassivate(BeanContext beanContext)
           
 boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
           
 boolean isBusinessMethod(java.lang.reflect.Method businessMethod)
          Is the method a business method of this container.
 boolean isCallerInRole(java.security.Principal callerPrincipal, java.lang.String roleName)
          
 boolean isClustered()
           
protected  void lockedStart()
           
protected  void lockedStop()
           
 java.lang.Object lookup(java.lang.String name)
          
 BeanContext<?> peekContext()
           
 BeanContext<?> popContext()
           
protected  void popEnc()
          Pops EJB's ENC from the stack.
 void processMetadata()
          introspects EJB container to find all dependencies and initialize any extra metadata.
 void pushContext(BeanContext<?> beanContext)
           
protected  void pushEnc()
          Makes sure that EJB's ENC is available Delegates to whatever implementation is used to push the ENC of the EJB onto the stack
protected  void reinitialize()
           
 java.lang.Object resolveAnnotation(java.lang.Class annotationType)
          Deprecated. use getAnnotation
 java.lang.Object resolveAnnotation(java.lang.reflect.Field field, java.lang.Class annotationType)
          Deprecated. use getAnnotation
 java.lang.Object resolveAnnotation(java.lang.reflect.Method method, java.lang.Class annotationType)
          Deprecated. use getAnnotation
 java.lang.Object resolveAnnotation(java.lang.reflect.Method m, java.lang.Class[] annotationChoices)
          Deprecated. this is going to be gone soon
protected abstract  java.util.List<java.lang.Class<?>> resolveBusinessInterfaces()
           
 java.lang.String resolveEJB(java.lang.String link, java.lang.Class<?> beanInterface, java.lang.String mappedName)
           
 Container resolveEjbContainer(java.lang.Class businessIntf)
           
 Container resolveEjbContainer(java.lang.String link, java.lang.Class businessIntf)
           
protected  void resolveInjectors()
          Deprecated. EJBContainer is no longer responsible for setting up ENC. Instead, SwitchBoard http://community.jboss.org/wiki/Switchboard will be setting it up.
 java.lang.String resolveMessageDestination(java.lang.String link)
          Find a message destination in a deployment.
 java.lang.String resolvePersistenceUnitSupplier(java.lang.String unitName)
          Find the MC bean that supplies the specified persistence unit.
 void setAssemblyDescriptor(org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData assembly)
          Deprecated. 
 void setBeanInstantiator(org.jboss.ejb3.instantiator.spi.BeanInstantiator beanInstantiator)
           
 void setCachedConnectionManager(org.jboss.jca.spi.ComponentStack ccm)
           
 void setDirectContainer(org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer> container)
           
 void setEjbEncFactory(EjbEncFactory encFactory)
           
 void setInjectionManager(org.jboss.injection.manager.spi.InjectionManager injectionManager)
           
 void setJaccContextId(java.lang.String jaccContextId)
           
 void setRollbackOnly()
          
 void setTransactionManager(javax.transaction.TransactionManager tm)
           
 void start()
          This should have been final, but ServiceContainer wants to butt in.
 void stop()
          This should have been final, but ServiceContainer wants to butt in.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.ejb3.Container
getMBean, getTimerService, getTimerService
 

Field Detail

encFactory

protected EjbEncFactory encFactory

pool

protected Pool pool

ejbName

protected java.lang.String ejbName

objectName

protected javax.management.ObjectName objectName

beanClassName

protected final java.lang.String beanClassName

classloader

protected final java.lang.ClassLoader classloader

injectors

protected java.util.List<Injector> injectors

enc

protected javax.naming.Context enc

initialContextProperties

protected java.util.Hashtable initialContextProperties

encInjectors

protected java.util.Map<java.lang.String,EncInjector> encInjectors

xml

protected org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData xml

assembly

protected org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData assembly

encInjections

protected java.util.Map<java.lang.String,java.util.Map<java.lang.reflect.AccessibleObject,Injector>> encInjections

invokeStats

protected InvocationStatistics invokeStats

reinitialize

protected boolean reinitialize

metadataBasedAnnotationRepo

protected org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData metadataBasedAnnotationRepo
Metadata based annotation repository


MANAGED_ENTITY_MANAGER_FACTORY

public static final java.lang.String MANAGED_ENTITY_MANAGER_FACTORY
See Also:
Constant Field Values

ENTITY_MANAGER_FACTORY

public static final java.lang.String ENTITY_MANAGER_FACTORY
See Also:
Constant Field Values
Constructor Detail

EJBContainer

protected EJBContainer(java.lang.String name,
                       org.jboss.aop.Domain domain,
                       java.lang.ClassLoader cl,
                       java.lang.String beanClassName,
                       java.lang.String ejbName,
                       java.util.Hashtable ctxProperties,
                       Ejb3Deployment deployment,
                       org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData beanMetaData)
                throws java.lang.ClassNotFoundException
Parameters:
name - Advisor name
manager - Domain to get interceptor bindings from
cl - the EJB's classloader
beanClassName -
ejbName -
ctxProperties -
interceptorRepository -
deployment -
beanMetaData - the meta data for this bean or null
Throws:
java.lang.ClassNotFoundException

EJBContainer

protected EJBContainer(java.lang.String name,
                       org.jboss.aop.Domain domain,
                       java.lang.ClassLoader cl,
                       java.lang.String beanClassName,
                       java.lang.String ejbName,
                       java.util.Hashtable ctxProperties,
                       org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData beanMetaData)
                throws java.lang.ClassNotFoundException
Create an EJBContainer

Parameters:
name - Name for the EJB container
manager - Domain to get interceptor bindings from
cl - the EJB's classloader
beanClassName - Fully qualified name of the ejb class
ejbName - The name of the EJB to which this container corresponds
ctxProperties - Context properties for this bean
beanMetaData - the meta data for this bean or null
Throws:
java.lang.ClassNotFoundException
Method Detail

canResolveEJB

@Deprecated
public boolean canResolveEJB()
Deprecated. 

Description copied from interface: EJBInjectionContainer
Although EJBInjectionContainer is implemented it may not be configured. If so, this will return false.

Specified by:
canResolveEJB in interface EJBInjectionContainer
Returns:
whether resolveEJB can be called.

createBeanContext

public abstract BeanContext<?> createBeanContext()
Description copied from interface: Container
Create a bean context for use in a pool.

Specified by:
createBeanContext in interface Container
Returns:
a ready to use bean context

createObjectName

public java.lang.String createObjectName(java.lang.String ejbName)
Description copied from interface: JavaEEComponent
Create an object name for the given EJB name in the same JavaEE module.

Specified by:
createObjectName in interface JavaEEComponent
Returns:

createInterceptor

public java.lang.Object createInterceptor(java.lang.Class<?> interceptorClass)
                                   throws java.lang.InstantiationException,
                                          java.lang.IllegalAccessException
Do not call, for BeanContainer.

Throws:
java.lang.IllegalAccessException
java.lang.InstantiationException

createObjectName

public java.lang.String createObjectName(java.lang.String unitName,
                                         java.lang.String ejbName)
Description copied from interface: JavaEEComponent
Create an object name for the given EJB name in another JavaEE module.

Specified by:
createObjectName in interface JavaEEComponent
Returns:

destroyBeanContext

public void destroyBeanContext(org.jboss.ejb3.interceptors.container.BeanContext<?> ctx)
Do nothing.

Parameters:
ctx -

getAdvisor

@Deprecated
public org.jboss.aop.Advisor getAdvisor()
Deprecated. 


getAnnotations

@Deprecated
public org.jboss.aop.annotation.AnnotationRepository getAnnotations()
Deprecated. 


getApplicationException

public javax.ejb.ApplicationException getApplicationException(java.lang.Class<?> exceptionType,
                                                              java.lang.reflect.Method invokedMethod)

getBeanContainer

protected BeanContainer getBeanContainer()

getInterceptorClasses

public java.util.Collection<java.lang.Class<?>> getInterceptorClasses()

getInterceptorInjectors

public java.util.Map<java.lang.Class<?>,InterceptorInjector> getInterceptorInjectors()

getClazz

public java.lang.Class<?> getClazz()
Deprecated. use getBeanClass

Returns:
the bean class of this container

getEffigy

protected org.jboss.ejb3.effigy.EnterpriseBeanEffigy getEffigy()

getEJBContainer

public static <C extends EJBContainer> C getEJBContainer(org.jboss.aop.Advisor advisor)

getName

public java.lang.String getName()
Specified by:
getName in interface Container

pushContext

public void pushContext(BeanContext<?> beanContext)
Specified by:
pushContext in interface Container

pushEnc

protected void pushEnc()
Makes sure that EJB's ENC is available Delegates to whatever implementation is used to push the ENC of the EJB onto the stack


peekContext

public BeanContext<?> peekContext()
Specified by:
peekContext in interface Container

popContext

public BeanContext<?> popContext()
Specified by:
popContext in interface Container

popEnc

protected void popEnc()
Pops EJB's ENC from the stack. Delegates to whatever implementation is used to pop the EJB's ENC from the stock


getEnvironmentRefGroup

public org.jboss.metadata.javaee.spec.Environment getEnvironmentRefGroup()
Specified by:
getEnvironmentRefGroup in interface InjectionContainer

getInjectors

public java.util.List<Injector> getInjectors()
Specified by:
getInjectors in interface InjectionContainer

getJaccContextId

public java.lang.String getJaccContextId()

getVirtualMethods

public java.util.List<java.lang.reflect.Method> getVirtualMethods()
Do not call, used by BeanContainer.

Returns:

setJaccContextId

public void setJaccContextId(java.lang.String jaccContextId)

getRootFile

public org.jboss.ejb3.vfs.spi.VirtualFile getRootFile()
Specified by:
getRootFile in interface InjectionContainer

getBusinessAndComponentInterfaces

public java.util.List<java.lang.Class<?>> getBusinessAndComponentInterfaces()
Return all the business interfaces implemented by this bean. Available after the meta data has been processed.

Returns:
an array of business interfaces or empty if no interface is provided

getDeploymentQualifiedName

public java.lang.String getDeploymentQualifiedName()

getDeploymentPropertyListString

public java.lang.String getDeploymentPropertyListString()
Returns a String identifier for this bean that is qualified by the deployment, and hence should be unique across deployments. Name is of the form "ear=foo.ear,jar=foo.jar,name=Bar", where "Bar" is the value returned by getEjbName(). The "ear=foo.ear" portion is ommitted if the bean is not packaged in an ear.


getDeploymentUnit

public DeploymentUnit getDeploymentUnit()

getDeployment

public Ejb3Deployment getDeployment()

getDependencyPolicy

public DependencyPolicy getDependencyPolicy()
Specified by:
getDependencyPolicy in interface Container
Specified by:
getDependencyPolicy in interface InjectionContainer

isAnnotationPresent

public boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)

isBusinessMethod

public boolean isBusinessMethod(java.lang.reflect.Method businessMethod)
Is the method a business method of this container.

Parameters:
businessMethod - the method in question
Returns:
true if so, otherwise false

processMetadata

public void processMetadata()
introspects EJB container to find all dependencies and initialize any extra metadata.

This must be called before container is registered with any microcontainer

Specified by:
processMetadata in interface Container
Parameters:
dependencyPolicy -

getInjectionHandlers

protected java.util.Collection<InjectionHandler<org.jboss.metadata.javaee.spec.Environment>> getInjectionHandlers()

checkForDuplicateLocalAndRemoteInterfaces

protected void checkForDuplicateLocalAndRemoteInterfaces()
                                                  throws javax.ejb.EJBException
Ensures that the bean does not implement any one interface as both @Local and @Remote EJBTHREE-1025

Throws:
javax.ejb.EJBException - If the bean does implements any one interface as both @Local and @Remote

getXml

public org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData getXml()

getAssemblyDescriptor

public org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData getAssemblyDescriptor()

setAssemblyDescriptor

@Deprecated
public void setAssemblyDescriptor(org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData assembly)
Deprecated. 


resolveBusinessInterfaces

protected abstract java.util.List<java.lang.Class<?>> resolveBusinessInterfaces()

getInterceptorRepository

public InterceptorInfoRepository getInterceptorRepository()

getEncInjectors

public java.util.Map<java.lang.String,EncInjector> getEncInjectors()
Specified by:
getEncInjectors in interface InjectionContainer

getCachedConnectionManager

public org.jboss.jca.spi.ComponentStack getCachedConnectionManager()

getClassloader

public java.lang.ClassLoader getClassloader()
Specified by:
getClassloader in interface InjectionContainer

getInitialContext

public javax.naming.InitialContext getInitialContext()
Specified by:
getInitialContext in interface Container

getEncInjections

public java.util.Map<java.lang.String,java.util.Map<java.lang.reflect.AccessibleObject,Injector>> getEncInjections()
Specified by:
getEncInjections in interface InjectionContainer

getEnc

public javax.naming.Context getEnc()
Specified by:
getEnc in interface Container
Specified by:
getEnc in interface InjectionContainer

getInitialContextProperties

public java.util.Hashtable getInitialContextProperties()
Specified by:
getInitialContextProperties in interface Container

getObjectName

public javax.management.ObjectName getObjectName()
Specified by:
getObjectName in interface Container

getEjbName

public java.lang.String getEjbName()
Specified by:
getEjbName in interface Container

getBeanClassName

public java.lang.String getBeanClassName()

getBeanClass

public java.lang.Class<?> getBeanClass()
Specified by:
getBeanClass in interface Container

getPool

public Pool getPool()
Specified by:
getPool in interface Container

getPartitionName

public java.lang.String getPartitionName()
Gets the name of the cluster partition with which this container is associated. Not available until EJBContainer.start() is completed.

Returns:
the name of the cluster partition with which this container is associated, or null if the container is not clustered

construct

protected java.lang.Object construct()
Delegates bean instance construction to the beanInstantiator

Returns:

reinitialize

protected void reinitialize()

create

public void create()
            throws java.lang.Exception
Specified by:
create in interface Container
Throws:
java.lang.Exception

start

public void start()
           throws java.lang.Exception
This should have been final, but ServiceContainer wants to butt in.

Specified by:
start in interface Container
Throws:
java.lang.Exception

lockedStart

protected void lockedStart()
                    throws java.lang.Exception
Throws:
java.lang.Exception

afterStart

protected void afterStart()
Invoked after all the dependencies on the containers have satisfied and the container is completely started and open for invocations. Containers can use this method as a callback point where they want to do some startup invocations on the container, which requires the container to be open for invocations (ex: restoring timers - see StatelessContainer)

See Also:
start()

stop

public void stop()
          throws java.lang.Exception
This should have been final, but ServiceContainer wants to butt in.

Specified by:
stop in interface Container
Throws:
java.lang.Exception

lockedStop

protected void lockedStop()
                   throws java.lang.Exception
Throws:
java.lang.Exception

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface Container
Throws:
java.lang.Exception

getSecurityManager

public <T> T getSecurityManager(java.lang.Class<T> type)
Description copied from interface: Container
Get the security manager associated with a container.

Specified by:
getSecurityManager in interface Container
Parameters:
type - the type to cast to
Returns:
the security manager or null if there is no manager associated

getTimeoutCallback

protected java.lang.reflect.Method getTimeoutCallback(org.jboss.metadata.ejb.spec.NamedMethodMetaData timeoutMethodMetaData,
                                                      java.lang.Class<?> beanClass)

initializePool

protected void initializePool()
                       throws java.lang.Exception
Throws:
java.lang.Exception

injectBeanContext

public void injectBeanContext(BeanContext<?> beanContext)
Note this method is a WIP. In actuality ejb3-interceptors should perform the injection itself, but this requires a rewrite of all injectors.

Specified by:
injectBeanContext in interface Container

invokeCallback

protected void invokeCallback(BeanContext<?> beanContext,
                              java.lang.Class<? extends java.lang.annotation.Annotation> callbackAnnotationClass)
Note that this method is a WIP.

Parameters:
beanContext -
callbackAnnotationClass - on of PostConstruct, PreDestroy, PostActivate or PrePassivate

invokePostConstruct

public void invokePostConstruct(BeanContext<?> beanContext)

invokePostConstruct

@Deprecated
public void invokePostConstruct(BeanContext beanContext,
                                           java.lang.Object[] params)
Deprecated. 

Specified by:
invokePostConstruct in interface Container

invokePreDestroy

public void invokePreDestroy(BeanContext beanContext)
Specified by:
invokePreDestroy in interface Container

invokePostActivate

public void invokePostActivate(BeanContext beanContext)
Specified by:
invokePostActivate in interface Container

invokePrePassivate

public void invokePrePassivate(BeanContext beanContext)
Specified by:
invokePrePassivate in interface Container

resolveInjectors

@Deprecated
protected void resolveInjectors()
                         throws java.lang.Exception
Deprecated. EJBContainer is no longer responsible for setting up ENC. Instead, SwitchBoard http://community.jboss.org/wiki/Switchboard will be setting it up.

Throws:
java.lang.Exception

getHandledCallbacks

protected java.lang.Class[] getHandledCallbacks()

findPartitionName

protected void findPartitionName()

getBusinessObject

public <T> T getBusinessObject(BeanContext<?> beanContext,
                               java.lang.Class<T> businessInterface)
                    throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getInvokedBusinessInterface

public java.lang.Object getInvokedBusinessInterface(BeanContext beanContext)
                                             throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

getInvokedInterface

protected java.lang.Object getInvokedInterface(java.lang.reflect.Method method)

resolveEJB

public java.lang.String resolveEJB(java.lang.String link,
                                   java.lang.Class<?> beanInterface,
                                   java.lang.String mappedName)
Specified by:
resolveEJB in interface EJBInjectionContainer

resolveEjbContainer

public Container resolveEjbContainer(java.lang.String link,
                                     java.lang.Class businessIntf)
Specified by:
resolveEjbContainer in interface InjectionContainer
Returns:

resolveEjbContainer

public Container resolveEjbContainer(java.lang.Class businessIntf)
                              throws javax.naming.NameNotFoundException
Specified by:
resolveEjbContainer in interface InjectionContainer
Returns:
Throws:
javax.naming.NameNotFoundException

resolveMessageDestination

public java.lang.String resolveMessageDestination(java.lang.String link)
Description copied from interface: InjectionContainer
Find a message destination in a deployment.

Specified by:
resolveMessageDestination in interface InjectionContainer
Parameters:
link - the message destination name
Returns:
the jndi name of the message destination

resolvePersistenceUnitSupplier

public java.lang.String resolvePersistenceUnitSupplier(java.lang.String unitName)
Description copied from interface: ExtendedInjectionContainer
Find the MC bean that supplies the specified persistence unit.

Specified by:
resolvePersistenceUnitSupplier in interface ExtendedInjectionContainer
Parameters:
unitName - the name of the persistence unit
Returns:
the name of the persistence unit supplier TODO: this method should be on InjectionContainer

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType,
                                                                   java.lang.Class<?> clazz)
Description copied from interface: InjectionContainer
If class has container overridable annotations, this method will discover those overriden annotations.

Specified by:
getAnnotation in interface InjectionContainer

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType,
                                                                   java.lang.Class<?> clazz,
                                                                   java.lang.reflect.Method method)
Description copied from interface: InjectionContainer
If class has container overridable annotations, this method will discover those overriden annotations.

Specified by:
getAnnotation in interface InjectionContainer

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType,
                                                                   java.lang.reflect.Method method)
Specified by:
getAnnotation in interface InjectionContainer

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType,
                                                                   java.lang.Class<?> clazz,
                                                                   java.lang.reflect.Field field)
Description copied from interface: InjectionContainer
If class has container overridable annotations, this method will discover those overriden annotations.

Specified by:
getAnnotation in interface InjectionContainer

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType,
                                                                   java.lang.reflect.Field field)
Specified by:
getAnnotation in interface InjectionContainer

resolveAnnotation

public java.lang.Object resolveAnnotation(java.lang.Class annotationType)
Deprecated. use getAnnotation


resolveAnnotation

public java.lang.Object resolveAnnotation(java.lang.reflect.Field field,
                                          java.lang.Class annotationType)
Deprecated. use getAnnotation


resolveAnnotation

public java.lang.Object resolveAnnotation(java.lang.reflect.Method method,
                                          java.lang.Class annotationType)
Deprecated. use getAnnotation


resolveAnnotation

public java.lang.Object resolveAnnotation(java.lang.reflect.Method m,
                                          java.lang.Class[] annotationChoices)
Deprecated. this is going to be gone soon


getIdentifier

public java.lang.String getIdentifier()
Description copied from interface: InjectionContainer
Some identifier that can be used in error messages

Specified by:
getIdentifier in interface InjectionContainer

getDeploymentDescriptorType

public java.lang.String getDeploymentDescriptorType()
Description copied from interface: InjectionContainer
For error messages

Specified by:
getDeploymentDescriptorType in interface InjectionContainer
Returns:
ejb-jar.xml, web.xml, etc..

getEjbJndiName

public java.lang.String getEjbJndiName(java.lang.Class businessInterface)
                                throws javax.naming.NameNotFoundException
Specified by:
getEjbJndiName in interface InjectionContainer
Throws:
javax.naming.NameNotFoundException

getEjbJndiName

public java.lang.String getEjbJndiName(java.lang.String link,
                                       java.lang.Class businessInterface)
Specified by:
getEjbJndiName in interface InjectionContainer

getInvokeStats

public InvocationStatistics getInvokeStats()
Specified by:
getInvokeStats in interface Container

getMethodInfo

@Deprecated
protected org.jboss.aop.MethodInfo getMethodInfo(java.lang.reflect.Method method)
Deprecated. 


isClustered

public boolean isClustered()
Specified by:
isClustered in interface Container

getModule

public JavaEEModule getModule()
Description copied from interface: JavaEEComponent
Returns the module of which this component is a part.

Specified by:
getModule in interface JavaEEComponent

setEjbEncFactory

public void setEjbEncFactory(EjbEncFactory encFactory)

hasJNDIBinding

public abstract boolean hasJNDIBinding(java.lang.String jndiName)
Specified by:
hasJNDIBinding in interface InjectionContainer

instantiated

public void instantiated()
After XML processing has been done this allows the container to further initialize the meta data.


setCachedConnectionManager

public void setCachedConnectionManager(org.jboss.jca.spi.ComponentStack ccm)

setDirectContainer

public void setDirectContainer(org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer> container)
Specified by:
setDirectContainer in interface org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>

getNonBridgeMethod

protected java.lang.reflect.Method getNonBridgeMethod(java.lang.reflect.Method bridgeMethod)

getInvocationLock

public java.util.concurrent.locks.Lock getInvocationLock()

setTransactionManager

public void setTransactionManager(javax.transaction.TransactionManager tm)

setInjectionManager

public void setInjectionManager(org.jboss.injection.manager.spi.InjectionManager injectionManager)

getMetaDataBasedAnnotationRepository

public org.jboss.ejb3.metadata.annotation.AnnotationRepositoryToMetaData getMetaDataBasedAnnotationRepository()
Returns AnnotationRepositoryToMetaData corresponding to this EJBContainer. The returned AnnotationRepositoryToMetaData is an implementation of AnnotationRepository and is capable of resolving annotations from bean metadata through the use of MetaDataBridges

Returns:

initMetaDataBasedAnnotationRepository

protected void initMetaDataBasedAnnotationRepository()
Initializes the metadata based annotation repository AnnotationRepositoryToMetaData, by setting up the appropriate metadata bridges.

Individual containers can then override this method to add more metadata bridges to the metadata based annotation repository.

Sets up metadata bridges for


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getEJBHome

public javax.ejb.EJBHome getEJBHome()
                             throws java.lang.IllegalStateException

Specified by:
getEJBHome in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalStateException

getEJBLocalHome

public javax.ejb.EJBLocalHome getEJBLocalHome()
                                       throws java.lang.IllegalStateException

Specified by:
getEJBLocalHome in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalStateException

getRollbackOnly

public boolean getRollbackOnly()
                        throws java.lang.IllegalStateException

Specified by:
getRollbackOnly in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalStateException

getUserTransaction

public javax.transaction.UserTransaction getUserTransaction()
                                                     throws java.lang.IllegalStateException

Specified by:
getUserTransaction in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalStateException

isCallerInRole

public boolean isCallerInRole(java.security.Principal callerPrincipal,
                              java.lang.String roleName)
                       throws java.lang.IllegalStateException

Specified by:
isCallerInRole in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalStateException

lookup

public java.lang.Object lookup(java.lang.String name)
                        throws java.lang.IllegalArgumentException

Specified by:
lookup in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalArgumentException

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException

Specified by:
setRollbackOnly in interface org.jboss.ejb3.context.spi.BeanManager
Throws:
java.lang.IllegalStateException

getInterceptors

protected org.jboss.aop.advice.Interceptor[] getInterceptors(org.jboss.aop.joinpoint.Joinpoint joinPoint,
                                                             java.lang.String interceptorStackName)
Parameters:
joinPoint -
interceptorStackName -
Returns:

getBeanInstantiator

protected org.jboss.ejb3.instantiator.spi.BeanInstantiator getBeanInstantiator()

setBeanInstantiator

public void setBeanInstantiator(org.jboss.ejb3.instantiator.spi.BeanInstantiator beanInstantiator)