org.jboss.ejb3.mdb
Class ConsumerContainer

java.lang.Object
  extended by org.jboss.ejb3.EJBContainer
      extended by org.jboss.ejb3.TimerServiceContainer
          extended by org.jboss.ejb3.mdb.MessagingContainer
              extended by org.jboss.ejb3.mdb.ConsumerContainer
All Implemented Interfaces:
Container, org.jboss.ejb3.context.spi.BeanManager, org.jboss.ejb3.context.spi.MessageDrivenBeanManager, org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>, JavaEEComponent, org.jboss.ejb3.timerservice.spi.MultiTimeoutMethodTimedObjectInvoker, org.jboss.ejb3.timerservice.spi.TimedObjectInvoker, EJBInjectionContainer, ExtendedInjectionContainer, InjectionContainer

public class ConsumerContainer
extends MessagingContainer

Comment


Field Summary
static java.lang.String CONSUMER_MESSAGE
          This is needed because API changed from JBoss 4.0.1sp1 to 4.0.2 TODO remove this after 4.0.2 is out.
protected static java.lang.String DEFAULT_DESTINATION_TYPE
          Default destination type.
protected  java.lang.Class messagingType
           
protected  java.lang.reflect.Method ON_MESSAGE
           
protected  java.util.ArrayList<ProducerFactory> producers
           
 
Fields inherited from class org.jboss.ejb3.mdb.MessagingContainer
activationSpec, DESTINATION, DESTINATION_TYPE, JMS_ADAPTOR, MAX_SESSION, messageEndpointFactory, PROVIDER_ADAPTER_JNDI
 
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
ConsumerContainer(java.lang.String ejbName, org.jboss.aop.Domain domain, java.lang.ClassLoader cl, java.lang.String beanClassName, java.util.Hashtable ctxProperties, Ejb3Deployment deployment, org.jboss.metadata.ejb.jboss.JBossConsumerBeanMetaData beanMetaData)
           
 
Method Summary
 org.jboss.aop.joinpoint.InvocationResponse dynamicInvoke(org.jboss.aop.joinpoint.Invocation invocation)
           
 java.util.Map<java.lang.String,org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData> getActivationConfigProperties()
           
 java.lang.Class<javax.jms.MessageListener> getMessagingType()
           
 org.jboss.aop.MethodInfo getMethodInfo(java.lang.reflect.Method method)
           
protected  java.lang.reflect.Method getOnMessage()
           
protected  org.jboss.metadata.ejb.spec.NamedMethodMetaData getTimeoutMethodMetaData()
           
 java.lang.Object localInvoke(org.jboss.aop.MethodInfo info, java.lang.Object[] args)
           
protected  void lockedStart()
          Initialize the container invoker.
protected  void lockedStop()
          Suspends the TimerService associated with this container.
protected  void populateActivationSpec()
           
protected  void registerProducers()
           
protected  java.util.List<java.lang.Class<?>> resolveBusinessInterfaces()
           
protected  void unregisterProducers()
           
 
Methods inherited from class org.jboss.ejb3.mdb.MessagingContainer
addActivationSpecProperty, callTimeout, callTimeout, createBeanContext, getDestination, getDestinationType, getDestinationType, getJMSProviderAdapter, getJmxName, getKeepAliveMillis, getMaxMessages, getMaxPoolSize, getMaxSession, getMBean, getMetaData, getMinPoolSize, getProviderAdapterJNDI, getResourceAdaptorName, getTimedObjectId, getTimedObjectInvoker, hasJNDIBinding, initializePool, innerCreateQueue, innerCreateTopic, innerStart, invokeSetMessageDrivenContext, isDeliveryActive, localInvoke, parseJndiSuffix, setMessageEndpointFactory, startDelivery, startProxies, stopDelivery, stopProxies
 
Methods inherited from class org.jboss.ejb3.TimerServiceContainer
afterStart, create, getTimerService, getTimerService, setTimerServiceFactory
 
Methods inherited from class org.jboss.ejb3.EJBContainer
canResolveEJB, checkForDuplicateLocalAndRemoteInterfaces, construct, createInterceptor, createObjectName, createObjectName, destroy, 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, getModule, getName, getNonBridgeMethod, getObjectName, getPartitionName, getPool, getRollbackOnly, getRootFile, getSecurityManager, getTimeoutCallback, getUserTransaction, getVirtualMethods, getXml, initMetaDataBasedAnnotationRepository, injectBeanContext, instantiated, invokeCallback, invokePostActivate, invokePostConstruct, invokePostConstruct, invokePreDestroy, invokePrePassivate, isAnnotationPresent, isBusinessMethod, isCallerInRole, isClustered, lookup, peekContext, popContext, popEnc, processMetadata, pushContext, pushEnc, reinitialize, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveEJB, resolveEjbContainer, resolveEjbContainer, resolveInjectors, resolveMessageDestination, resolvePersistenceUnitSupplier, setAssemblyDescriptor, setBeanInstantiator, setCachedConnectionManager, setDirectContainer, setEjbEncFactory, setInjectionManager, setJaccContextId, setRollbackOnly, setTransactionManager, start, stop, 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
 

Field Detail

messagingType

protected java.lang.Class messagingType

ON_MESSAGE

protected java.lang.reflect.Method ON_MESSAGE

producers

protected java.util.ArrayList<ProducerFactory> producers

DEFAULT_DESTINATION_TYPE

protected static final java.lang.String DEFAULT_DESTINATION_TYPE
Default destination type. Used when no message-driven-destination is given in ejb-jar, and a lookup of destinationJNDI from jboss.xml is not successfull. Default value: javax.jms.Topic.

See Also:
Constant Field Values

CONSUMER_MESSAGE

public static final java.lang.String CONSUMER_MESSAGE
This is needed because API changed from JBoss 4.0.1sp1 to 4.0.2 TODO remove this after 4.0.2 is out.

See Also:
Constant Field Values
Constructor Detail

ConsumerContainer

public ConsumerContainer(java.lang.String ejbName,
                         org.jboss.aop.Domain domain,
                         java.lang.ClassLoader cl,
                         java.lang.String beanClassName,
                         java.util.Hashtable ctxProperties,
                         Ejb3Deployment deployment,
                         org.jboss.metadata.ejb.jboss.JBossConsumerBeanMetaData beanMetaData)
                  throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException
Method Detail

dynamicInvoke

public org.jboss.aop.joinpoint.InvocationResponse dynamicInvoke(org.jboss.aop.joinpoint.Invocation invocation)
                                                         throws java.lang.Throwable
Throws:
java.lang.Throwable

getOnMessage

protected java.lang.reflect.Method getOnMessage()

getTimeoutMethodMetaData

protected org.jboss.metadata.ejb.spec.NamedMethodMetaData getTimeoutMethodMetaData()
Specified by:
getTimeoutMethodMetaData in class MessagingContainer

localInvoke

public java.lang.Object localInvoke(org.jboss.aop.MethodInfo info,
                                    java.lang.Object[] args)
                             throws java.lang.Throwable
Overrides:
localInvoke in class MessagingContainer
Throws:
java.lang.Throwable

getMessagingType

public java.lang.Class<javax.jms.MessageListener> getMessagingType()
Specified by:
getMessagingType in class MessagingContainer

getMethodInfo

public org.jboss.aop.MethodInfo getMethodInfo(java.lang.reflect.Method method)
Overrides:
getMethodInfo in class MessagingContainer

getActivationConfigProperties

public java.util.Map<java.lang.String,org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData> getActivationConfigProperties()
Specified by:
getActivationConfigProperties in class MessagingContainer

resolveBusinessInterfaces

protected java.util.List<java.lang.Class<?>> resolveBusinessInterfaces()
Specified by:
resolveBusinessInterfaces in class EJBContainer

lockedStart

protected void lockedStart()
                    throws java.lang.Exception
Initialize the container invoker. Sets up a connection, a server session pool and a connection consumer for the configured destination.

Any JMSExceptions produced while initializing will be assumed to be caused due to JMS Provider failure.

Overrides:
lockedStart in class MessagingContainer
Throws:
java.lang.Exception - Failed to initalize.

registerProducers

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

unregisterProducers

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

populateActivationSpec

protected void populateActivationSpec()
Specified by:
populateActivationSpec in class MessagingContainer

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 MessagingContainer
Throws:
java.lang.Exception
See Also:
EJBContainer.lockedStop()