org.jboss.ejb3.service
Class ServiceContainer

java.lang.Object
  extended by org.jboss.ejb3.EJBContainer
      extended by org.jboss.ejb3.TimerServiceContainer
          extended by org.jboss.ejb3.session.SessionContainer
              extended by org.jboss.ejb3.service.ServiceContainer
All Implemented Interfaces:
Container, org.jboss.ejb3.context.spi.BeanManager, org.jboss.ejb3.context.spi.SessionBeanManager, org.jboss.ejb3.endpoint.Endpoint, org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>, JavaEEComponent, org.jboss.ejb3.proxy.spi.container.InvokableContext, org.jboss.ejb3.timerservice.spi.TimedObjectInvoker, EJBInjectionContainer, ExtendedInjectionContainer, InjectionContainer

public class ServiceContainer
extends SessionContainer
implements org.jboss.ejb3.timerservice.spi.TimedObjectInvoker, org.jboss.ejb3.proxy.spi.container.InvokableContext


Field Summary
 
Fields inherited from class org.jboss.ejb3.session.SessionContainer
proxyDeployer
 
Fields inherited from class org.jboss.ejb3.TimerServiceContainer
timerService
 
Fields inherited from class org.jboss.ejb3.EJBContainer
assembly, beanClassName, classloader, ejbName, enc, encFactory, encInjections, encInjectors, ENTITY_MANAGER_FACTORY, initialContextProperties, injectors, invokeStats, MANAGED_ENTITY_MANAGER_FACTORY, metadataBasedAnnotationRepo, objectName, pool, reinitialize, xml
 
Fields inherited from interface org.jboss.ejb3.Container
ENC_CTX_NAME
 
Constructor Summary
ServiceContainer(javax.management.MBeanServer server, java.lang.ClassLoader cl, java.lang.String beanClassName, java.lang.String ejbName, org.jboss.aop.Domain domain, java.util.Hashtable ctxProperties, Ejb3Deployment deployment, org.jboss.metadata.ejb.jboss.JBossServiceBeanMetaData beanMetaData)
           
 
Method Summary
 void callTimeout(javax.ejb.Timer timer)
           
 void create()
          Creates a TimerService for this container.
 BeanContext<?> createBeanContext()
          Create a bean context for use in a pool.
 java.lang.Object createLocalProxy(java.lang.Object id, org.jboss.ejb3.annotation.LocalBinding binding)
           
 java.lang.Object createRemoteProxy(java.lang.Object id, org.jboss.ejb3.annotation.RemoteBinding binding)
          Deprecated. 
 java.io.Serializable createSession(java.lang.Class<?>[] initTypes, java.lang.Object[] initArgs)
          Create session to an EJB bean.
 void destroy()
           
 org.jboss.aop.joinpoint.InvocationResponse dynamicInvoke(org.jboss.aop.joinpoint.Invocation invocation)
          Entry point for remoting-based invocations via InvokableContextClassProxyHack
 java.lang.Object getAttribute(java.lang.String attribute)
           
 javax.management.AttributeList getAttributes(java.lang.String[] attributes)
           
protected  java.lang.String getJndiRegistrarBindName()
          Returns the name under which the JNDI Registrar for this container is bound
 java.lang.Object getMBean()
           
 javax.management.MBeanInfo getMBeanInfo()
           
 java.lang.Object getSingleton()
           
 java.lang.String getTimedObjectId()
           
protected  org.jboss.ejb3.timerservice.spi.TimedObjectInvoker getTimedObjectInvoker()
          Returns the TimedObjectInvoker which will be used by the timer implementations to invoke the timeout method (annotated with Timeout or specified in deployment descriptor) on the bean.
protected  void initBeanContext()
           
 void initializePool()
           
protected  void injectDependencies(BeanContext ctx)
           
 void instantiated()
          After XML processing has been done this allows the container to further initialize the meta data.
 java.lang.Object invoke(java.lang.Object proxy, org.jboss.ejb3.common.lang.SerializableMethod method, java.lang.Object[] args)
          Deprecated. To be removed alongside InvokableContext
 java.lang.Object invoke(java.io.Serializable session, java.lang.Class<?> invokedBusinessInterface, java.lang.reflect.Method method, java.lang.Object[] args)
          Invokes upon the specified method, using the specified arguments
 java.lang.Object invoke(java.lang.String actionName, java.lang.Object[] params, java.lang.String[] signature)
           
 java.lang.Object localHomeInvoke(java.lang.reflect.Method method, java.lang.Object[] args)
           
 java.lang.Object localInvoke(java.lang.reflect.Method method, java.lang.Object[] args)
          Performs a synchronous or asynchronous local invocation
 java.lang.Object localInvoke(java.lang.Object id, java.lang.reflect.Method method, java.lang.Object[] args)
           
protected  void lockedStart()
           
protected  void lockedStop()
          Suspends the TimerService associated with this container.
 BeanContext<?> peekContext()
           
protected  StatefulContainerInvocation populateInvocation(StatefulContainerInvocation invocation)
          Allow a container sub class to supplement an invocation.
protected  void reinitialize()
           
protected  void removeHandle(javax.ejb.Handle handle)
           
protected  java.util.List<java.lang.Class<?>> resolveBusinessInterfaces()
           
 void setAttribute(javax.management.Attribute attribute)
           
 javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)
           
 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.
 
Methods inherited from class org.jboss.ejb3.session.SessionContainer
constructProperNoSuchEjbException, createSession, destroySession, getBusinessObject, getClusterFamilies, getEJBLocalObject, getEJBObject, getJndiRegistrar, getMetaData, getProxyFactory, getProxyFactory, getProxyFactory, getRemoteBinding, getSessionFactory, getVirtualMethods, hasJNDIBinding, invoke, invokeEJBObjectMethod, invokeSetSessionContext, isSessionAware, marshallException, marshallResponse, registerWithAopDispatcher, setJndiRegistrar
 
Methods inherited from class org.jboss.ejb3.TimerServiceContainer
afterStart, getTimerService, getTimerService, setTimerServiceFactory
 
Methods inherited from class org.jboss.ejb3.EJBContainer
canResolveEJB, checkForDuplicateLocalAndRemoteInterfaces, construct, createInterceptor, createObjectName, createObjectName, destroyBeanContext, findPartitionName, getAdvisor, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotations, getApplicationException, getAssemblyDescriptor, getBeanClass, getBeanClassName, getBeanContainer, getBeanInstantiator, getBusinessAndComponentInterfaces, getBusinessObject, getCachedConnectionManager, getClassloader, getClazz, getDependencyPolicy, getDeployment, getDeploymentDescriptorType, getDeploymentPropertyListString, getDeploymentQualifiedName, getDeploymentUnit, getEffigy, getEJBContainer, getEJBHome, getEjbJndiName, getEjbJndiName, getEJBLocalHome, getEjbName, getEnc, getEncInjections, getEncInjectors, getEnvironmentRefGroup, getHandledCallbacks, getIdentifier, getInitialContext, getInitialContextProperties, getInjectionHandlers, getInjectors, getInterceptorClasses, getInterceptorInjectors, getInterceptorRepository, getInterceptors, getInvocationLock, getInvokedBusinessInterface, getInvokedInterface, getInvokeStats, getJaccContextId, getMetaDataBasedAnnotationRepository, getMethodInfo, getModule, getName, getNonBridgeMethod, getObjectName, getPartitionName, getPool, getRollbackOnly, getRootFile, getSecurityManager, getTimeoutCallback, getUserTransaction, getXml, initMetaDataBasedAnnotationRepository, injectBeanContext, invokeCallback, invokePostActivate, invokePostConstruct, invokePostConstruct, invokePreDestroy, invokePrePassivate, isAnnotationPresent, isBusinessMethod, isCallerInRole, isClustered, lookup, popContext, popEnc, processMetadata, pushContext, pushEnc, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveEJB, resolveEjbContainer, resolveEjbContainer, resolveInjectors, resolveMessageDestination, resolvePersistenceUnitSupplier, setAssemblyDescriptor, setBeanInstantiator, setCachedConnectionManager, setDirectContainer, setEjbEncFactory, setInjectionManager, setJaccContextId, setRollbackOnly, setTransactionManager, 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.context.spi.BeanManager
getEJBHome, getEJBLocalHome, getRollbackOnly, getTimerService, getUserTransaction, isCallerInRole, lookup, setRollbackOnly
 

Constructor Detail

ServiceContainer

public ServiceContainer(javax.management.MBeanServer server,
                        java.lang.ClassLoader cl,
                        java.lang.String beanClassName,
                        java.lang.String ejbName,
                        org.jboss.aop.Domain domain,
                        java.util.Hashtable ctxProperties,
                        Ejb3Deployment deployment,
                        org.jboss.metadata.ejb.jboss.JBossServiceBeanMetaData beanMetaData)
                 throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException
Method Detail

callTimeout

public void callTimeout(javax.ejb.Timer timer)
                 throws java.lang.Exception
Specified by:
callTimeout in interface org.jboss.ejb3.timerservice.spi.TimedObjectInvoker
Throws:
java.lang.Exception

createBeanContext

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

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

createSession

public java.io.Serializable createSession(java.lang.Class<?>[] initTypes,
                                          java.lang.Object[] initArgs)
Description copied from class: SessionContainer
Create session to an EJB bean.

Specified by:
createSession in class SessionContainer
Parameters:
initTypes - the parameter types used by the home's create method
initArgs - the arguments for the home's create method
Returns:
the identifier of the session

getJndiRegistrarBindName

protected java.lang.String getJndiRegistrarBindName()
Returns the name under which the JNDI Registrar for this container is bound

Specified by:
getJndiRegistrarBindName in class SessionContainer
Returns:

getMBean

public java.lang.Object getMBean()
Specified by:
getMBean in interface Container

getSingleton

public java.lang.Object getSingleton()

create

public void create()
            throws java.lang.Exception
Description copied from class: TimerServiceContainer
Creates a TimerService for this container. TimerService creation is skipped for stateful session beans, since stateful session beans do not support timerservice

Specified by:
create in interface Container
Overrides:
create in class TimerServiceContainer
Throws:
java.lang.Exception
See Also:
EJBContainer.create()

instantiated

public void instantiated()
Description copied from class: EJBContainer
After XML processing has been done this allows the container to further initialize the meta data.

Overrides:
instantiated in class SessionContainer

resolveBusinessInterfaces

protected java.util.List<java.lang.Class<?>> resolveBusinessInterfaces()
Overrides:
resolveBusinessInterfaces in class SessionContainer

reinitialize

protected void reinitialize()
Overrides:
reinitialize in class EJBContainer

lockedStart

protected void lockedStart()
                    throws java.lang.Exception
Overrides:
lockedStart in class SessionContainer
Throws:
java.lang.Exception

lockedStop

protected void lockedStop()
                   throws java.lang.Exception
Description copied from class: TimerServiceContainer
Suspends the TimerService associated with this container.

This method skips timerservice suspension of stateful session beans

Overrides:
lockedStop in class SessionContainer
Throws:
java.lang.Exception
See Also:
EJBContainer.lockedStop()

destroy

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

initializePool

public void initializePool()
                    throws java.lang.Exception
Overrides:
initializePool in class EJBContainer
Throws:
java.lang.Exception

localInvoke

public java.lang.Object localInvoke(java.lang.Object id,
                                    java.lang.reflect.Method method,
                                    java.lang.Object[] args)
                             throws java.lang.Throwable
Specified by:
localInvoke in class SessionContainer
Throws:
java.lang.Throwable

localHomeInvoke

public java.lang.Object localHomeInvoke(java.lang.reflect.Method method,
                                        java.lang.Object[] args)
                                 throws java.lang.Throwable
Specified by:
localHomeInvoke in class SessionContainer
Throws:
java.lang.Throwable

localInvoke

public java.lang.Object localInvoke(java.lang.reflect.Method method,
                                    java.lang.Object[] args)
                             throws java.lang.Throwable
Performs a synchronous or asynchronous local invocation

Parameters:
provider - If null a synchronous invocation, otherwise an asynchronous
Throws:
java.lang.Throwable

dynamicInvoke

public org.jboss.aop.joinpoint.InvocationResponse dynamicInvoke(org.jboss.aop.joinpoint.Invocation invocation)
                                                         throws java.lang.Throwable
Description copied from class: SessionContainer
Entry point for remoting-based invocations via InvokableContextClassProxyHack

Specified by:
dynamicInvoke in interface org.jboss.ejb3.proxy.spi.container.InvokableContext
Specified by:
dynamicInvoke in class SessionContainer
Throws:
java.lang.Throwable

initBeanContext

protected void initBeanContext()
                        throws java.lang.RuntimeException
Throws:
java.lang.RuntimeException

peekContext

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

populateInvocation

protected StatefulContainerInvocation populateInvocation(StatefulContainerInvocation invocation)
Description copied from class: SessionContainer
Allow a container sub class to supplement an invocation. Per default nothing to supplement.

Overrides:
populateInvocation in class SessionContainer
Returns:

injectDependencies

protected void injectDependencies(BeanContext ctx)

getAttribute

public java.lang.Object getAttribute(java.lang.String attribute)
                              throws javax.management.AttributeNotFoundException,
                                     javax.management.MBeanException,
                                     javax.management.ReflectionException
Throws:
javax.management.AttributeNotFoundException
javax.management.MBeanException
javax.management.ReflectionException

setAttribute

public void setAttribute(javax.management.Attribute attribute)
                  throws javax.management.AttributeNotFoundException,
                         javax.management.InvalidAttributeValueException,
                         javax.management.MBeanException,
                         javax.management.ReflectionException
Throws:
javax.management.AttributeNotFoundException
javax.management.InvalidAttributeValueException
javax.management.MBeanException
javax.management.ReflectionException

getAttributes

public javax.management.AttributeList getAttributes(java.lang.String[] attributes)

setAttributes

public javax.management.AttributeList setAttributes(javax.management.AttributeList attributes)

invoke

@Deprecated
public java.lang.Object invoke(java.lang.Object proxy,
                                          org.jboss.ejb3.common.lang.SerializableMethod method,
                                          java.lang.Object[] args)
                        throws java.lang.Throwable
Deprecated. To be removed alongside InvokableContext

Specified by:
invoke in interface org.jboss.ejb3.proxy.spi.container.InvokableContext
Throws:
java.lang.Throwable
See Also:
InvokableContext

invoke

public java.lang.Object invoke(java.io.Serializable session,
                               java.lang.Class<?> invokedBusinessInterface,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Invokes upon the specified method, using the specified arguments

Specified by:
invoke in interface org.jboss.ejb3.endpoint.Endpoint
Throws:
java.lang.Throwable
See Also:
Endpoint.invoke(java.io.Serializable, java.lang.Class, java.lang.reflect.Method, java.lang.Object[])

invoke

public java.lang.Object invoke(java.lang.String actionName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws javax.management.MBeanException,
                               javax.management.ReflectionException
Throws:
javax.management.MBeanException
javax.management.ReflectionException

getMBeanInfo

public javax.management.MBeanInfo getMBeanInfo()

createLocalProxy

public java.lang.Object createLocalProxy(java.lang.Object id,
                                         org.jboss.ejb3.annotation.LocalBinding binding)
                                  throws java.lang.Exception
Throws:
java.lang.Exception

createRemoteProxy

@Deprecated
public java.lang.Object createRemoteProxy(java.lang.Object id,
                                                     org.jboss.ejb3.annotation.RemoteBinding binding)
                                   throws java.lang.Exception
Deprecated. 

Throws:
java.lang.Exception

getTimedObjectId

public java.lang.String getTimedObjectId()
Specified by:
getTimedObjectId in interface org.jboss.ejb3.timerservice.spi.TimedObjectInvoker

removeHandle

protected void removeHandle(javax.ejb.Handle handle)
Specified by:
removeHandle in class SessionContainer

start

public void start()
           throws java.lang.Exception
Description copied from class: EJBContainer
This should have been final, but ServiceContainer wants to butt in.

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

stop

public void stop()
          throws java.lang.Exception
Description copied from class: EJBContainer
This should have been final, but ServiceContainer wants to butt in.

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

getTimedObjectInvoker

protected org.jboss.ejb3.timerservice.spi.TimedObjectInvoker getTimedObjectInvoker()
Description copied from class: TimerServiceContainer
Returns the TimedObjectInvoker which will be used by the timer implementations to invoke the timeout method (annotated with Timeout or specified in deployment descriptor) on the bean.

Specified by:
getTimedObjectInvoker in class TimerServiceContainer
Returns: