org.jboss.ejb3.mdb
Class MessagingContainer

java.lang.Object
  extended by org.jboss.ejb3.EJBContainer
      extended by org.jboss.ejb3.mdb.MessagingContainer
All Implemented Interfaces:
Container, org.jboss.ejb3.interceptors.direct.IndirectContainer<EJBContainer,org.jboss.ejb3.interceptors.direct.DirectContainer<EJBContainer>>, JavaEEComponent, org.jboss.ejb3.timerservice.spi.TimedObjectInvoker, ExtendedInjectionContainer, InjectionContainer
Direct Known Subclasses:
ConsumerContainer, MDB

public abstract class MessagingContainer
extends EJBContainer
implements org.jboss.ejb3.timerservice.spi.TimedObjectInvoker

Version:
$Revision: 84054 $
Author:
William DeCoste

Field Summary
protected  ActivationSpec activationSpec
           
protected static String DEFAULT_DESTINATION_TYPE
          Default destination type.
protected static String DESTINATION
           
protected static String DESTINATION_TYPE
           
protected static String JMS_ADAPTOR
           
protected static String MAX_SESSION
           
protected  JBossMessageEndpointFactory messageEndpointFactory
           
protected static String PROVIDER_ADAPTER_JNDI
           
protected  javax.ejb.TimerService timerService
           
 
Fields inherited from class org.jboss.ejb3.EJBContainer
assembly, beanClassName, classloader, defaultConstructorIndex, ejbName, enc, encFactory, encInjections, encInjectors, ENTITY_MANAGER_FACTORY, initialContextProperties, injectors, invokeStats, MANAGED_ENTITY_MANAGER_FACTORY, objectName, pool, reinitialize, xml
 
Fields inherited from interface org.jboss.ejb3.Container
ENC_CTX_NAME
 
Constructor Summary
MessagingContainer(String ejbName, org.jboss.aop.Domain domain, ClassLoader cl, String beanClassName, Hashtable ctxProperties, Ejb3Deployment deployment, org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData beanMetaData)
           
 
Method Summary
protected  void addActivationSpecProperty(Map<String,org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData> result, javax.ejb.ActivationConfigProperty property)
           
 void callTimeout(javax.ejb.Timer timer)
           
 BeanContext<?> createBeanContext()
          Create a bean context for use in a pool.
abstract  Map<String,org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData> getActivationConfigProperties()
           
protected  String getDestination()
           
protected  String getDestinationType()
           
protected  String getDestinationType(Context ctx, String destinationJNDI)
          Try to get a destination type by looking up the destination JNDI, or provide a default if there is not destinationJNDI or if it is not possible to lookup.
protected  org.jboss.jms.jndi.JMSProviderAdapter getJMSProviderAdapter()
          Return the JMSProviderAdapter that should be used.
 ObjectName getJmxName()
           
 int getKeepAliveMillis()
           
 int getMaxMessages()
           
 int getMaxPoolSize()
           
protected  String getMaxSession()
           
 Object getMBean()
           
abstract  Class getMessagingType()
           
protected  org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData getMetaData()
           
 org.jboss.aop.MethodInfo getMethodInfo(Method method)
          Deprecated. 
 int getMinPoolSize()
           
protected  String getProviderAdapterJNDI()
           
 String getResourceAdaptorName()
           
 String getTimedObjectId()
           
protected abstract  org.jboss.metadata.ejb.spec.NamedMethodMetaData getTimeoutMethodMetaData()
           
 javax.ejb.TimerService getTimerService()
           
 javax.ejb.TimerService getTimerService(Object pKey)
          This method is called by EJBTimerServiceImpl to re-establish a persistent timer.
 boolean hasJNDIBinding(String jndiName)
          A messaging container is bound to a message destination and thus has no JNDI binding of it's own.
protected  void initializePool()
           
protected  void innerCreateQueue(Context context)
           
protected  void innerCreateTopic(Context context)
           
protected  void innerStart()
           
protected  boolean isDeliveryActive()
           
 Object localInvoke(org.jboss.aop.MethodInfo info, Object[] args)
           
 Object localInvoke(Method method, Object[] args)
           
protected  void lockedStart()
          Initialize the container invoker.
protected  void lockedStop()
           
protected  String parseJndiSuffix(String jndiname, String defautSuffix)
          Parse the JNDI suffix from the given JNDI name.
protected abstract  void populateActivationSpec()
           
 void setMessageEndpointFactory(JBossMessageEndpointFactory messageEndpointFactory)
           
 void setTimerServiceFactory(org.jboss.ejb3.timerservice.spi.TimerServiceFactory factory)
           
protected  void startDelivery()
           
protected  void startProxies()
           
protected  void stopDelivery()
           
protected  void stopProxies()
           
 
Methods inherited from class org.jboss.ejb3.EJBContainer
checkForDuplicateLocalAndRemoteInterfaces, construct, create, createInterceptor, createObjectName, createObjectName, destroy, destroyBeanContext, findPartitionName, getAdvisor, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotation, getAnnotations, getAssemblyDescriptor, getBeanClass, getBeanClassName, getBeanContainer, getBusinessInterfaces, getBusinessObject, getCachedConnectionManager, getClassloader, getClazz, getDependencyPolicy, getDeployment, getDeploymentDescriptorType, getDeploymentPropertyListString, getDeploymentQualifiedName, getDeploymentUnit, getEJBContainer, getEjbJndiName, getEjbJndiName, getEjbName, getEnc, getEncInjections, getEncInjectors, getEnvironmentRefGroup, getHandledCallbacks, getIdentifier, getInitialContext, getInitialContextProperties, getInjectors, getInterceptorRepository, getInvocationLock, getInvokedBusinessInterface, getInvokedInterface, getInvokeStats, getJaccContextId, getModule, getName, getNonBridgeMethod, getObjectName, getPartitionName, getPool, getRootFile, getSecurityManager, getTimeoutCallback, getVirtualMethods, getXml, injectBeanContext, instantiated, invokeCallback, invokeInit, invokePostActivate, invokePostConstruct, invokePostConstruct, invokePreDestroy, invokePrePassivate, isAnnotationPresent, isBusinessMethod, isClustered, peekContext, popContext, popEnc, processMetadata, pushContext, pushEnc, reinitialize, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveAnnotation, resolveBusinessInterfaces, resolveEjbContainer, resolveEjbContainer, resolveInjectors, resolveMessageDestination, resolvePersistenceUnitSupplier, setAssemblyDescriptor, setCachedConnectionManager, setDirectContainer, setJaccContextId, setTransactionManager, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

timerService

protected javax.ejb.TimerService timerService

activationSpec

protected ActivationSpec activationSpec

messageEndpointFactory

protected JBossMessageEndpointFactory messageEndpointFactory

DEFAULT_DESTINATION_TYPE

protected static final 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

JMS_ADAPTOR

protected static final String JMS_ADAPTOR
See Also:
Constant Field Values

DESTINATION

protected static final String DESTINATION
See Also:
Constant Field Values

DESTINATION_TYPE

protected static final String DESTINATION_TYPE
See Also:
Constant Field Values

PROVIDER_ADAPTER_JNDI

protected static final String PROVIDER_ADAPTER_JNDI
See Also:
Constant Field Values

MAX_SESSION

protected static final String MAX_SESSION
See Also:
Constant Field Values
Constructor Detail

MessagingContainer

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

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

getMBean

public Object getMBean()
Specified by:
getMBean in interface Container

getMetaData

protected org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData getMetaData()

getTimeoutMethodMetaData

protected abstract org.jboss.metadata.ejb.spec.NamedMethodMetaData getTimeoutMethodMetaData()

getMessagingType

public abstract Class getMessagingType()

getActivationConfigProperties

public abstract Map<String,org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData> getActivationConfigProperties()

populateActivationSpec

protected abstract void populateActivationSpec()

getMethodInfo

@Deprecated
public org.jboss.aop.MethodInfo getMethodInfo(Method method)
Deprecated. 

Overrides:
getMethodInfo in class EJBContainer

setMessageEndpointFactory

public void setMessageEndpointFactory(JBossMessageEndpointFactory messageEndpointFactory)

getResourceAdaptorName

public String getResourceAdaptorName()

addActivationSpecProperty

protected void addActivationSpecProperty(Map<String,org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData> result,
                                         javax.ejb.ActivationConfigProperty property)

lockedStart

protected void lockedStart()
                    throws 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 EJBContainer
Throws:
Exception - Failed to initalize.

startDelivery

protected void startDelivery()

innerStart

protected void innerStart()
                   throws Exception
Throws:
Exception

isDeliveryActive

protected boolean isDeliveryActive()

getJmxName

public ObjectName getJmxName()

startProxies

protected void startProxies()
                     throws Exception
Throws:
Exception

parseJndiSuffix

protected String parseJndiSuffix(String jndiname,
                                 String defautSuffix)
Parse the JNDI suffix from the given JNDI name.

Parameters:
jndiname - The JNDI name used to lookup the destination.
defautSuffix - Description of Parameter
Returns:
The parsed suffix or the defaultSuffix

localInvoke

public Object localInvoke(Method method,
                          Object[] args)
                   throws Throwable
Throws:
Throwable

localInvoke

public Object localInvoke(org.jboss.aop.MethodInfo info,
                          Object[] args)
                   throws Throwable
Throws:
Throwable

getTimerService

public javax.ejb.TimerService getTimerService()
Specified by:
getTimerService in interface Container

getTimerService

public javax.ejb.TimerService getTimerService(Object pKey)
Description copied from interface: Container
This method is called by EJBTimerServiceImpl to re-establish a persistent timer.

Specified by:
getTimerService in interface Container

callTimeout

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

lockedStop

protected void lockedStop()
                   throws Exception
Overrides:
lockedStop in class EJBContainer
Throws:
Exception

stopDelivery

protected void stopDelivery()

stopProxies

protected void stopProxies()
                    throws Exception
Throws:
Exception

initializePool

protected void initializePool()
                       throws Exception
Overrides:
initializePool in class EJBContainer
Throws:
Exception

getProviderAdapterJNDI

protected String getProviderAdapterJNDI()

getMaxSession

protected String getMaxSession()

getDestination

protected String getDestination()

getDestinationType

protected String getDestinationType()

innerCreateQueue

protected void innerCreateQueue(Context context)
                         throws Exception
Throws:
Exception

innerCreateTopic

protected void innerCreateTopic(Context context)
                         throws Exception
Throws:
Exception

getJMSProviderAdapter

protected org.jboss.jms.jndi.JMSProviderAdapter getJMSProviderAdapter()
                                                               throws NamingException
Return the JMSProviderAdapter that should be used.

Returns:
The JMSProviderAdapter to use.
Throws:
NamingException

getDestinationType

protected String getDestinationType(Context ctx,
                                    String destinationJNDI)
Try to get a destination type by looking up the destination JNDI, or provide a default if there is not destinationJNDI or if it is not possible to lookup.

Parameters:
ctx - The naming context to lookup destinations from.
destinationJNDI - The name to use when looking up destinations.
Returns:
The destination type, either derived from destinationJDNI or DEFAULT_DESTINATION_TYPE

hasJNDIBinding

public boolean hasJNDIBinding(String jndiName)
A messaging container is bound to a message destination and thus has no JNDI binding of it's own.

Specified by:
hasJNDIBinding in interface InjectionContainer
Specified by:
hasJNDIBinding in class EJBContainer

getMinPoolSize

public int getMinPoolSize()

getMaxPoolSize

public int getMaxPoolSize()

getMaxMessages

public int getMaxMessages()

getKeepAliveMillis

public int getKeepAliveMillis()

getTimedObjectId

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

setTimerServiceFactory

public void setTimerServiceFactory(org.jboss.ejb3.timerservice.spi.TimerServiceFactory factory)


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