org.jboss.ejb.plugins.inflow
Class JBossMessageEndpointFactory

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.ejb.plugins.inflow.JBossMessageEndpointFactory
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, javax.resource.spi.endpoint.MessageEndpointFactory, AllowedOperationsFlags, ContainerPlugin, EJBProxyFactory, GenericEntityObjectFactory, JBossMessageEndpointFactoryMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean
Direct Known Subclasses:
JBossJMSMessageEndpointFactory

public class JBossMessageEndpointFactory
extends ServiceMBeanSupport
implements EJBProxyFactory, javax.resource.spi.endpoint.MessageEndpointFactory, JBossMessageEndpointFactoryMBean

EJBProxyFactory for inflow message driven beans

Version:
$Revision: 66932 $
Author:
Adrian Brock .

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.ejb.GenericEntityObjectFactory
GenericEntityObjectFactory.UTIL
 
Field Summary
protected  String[] activationSig
          The signature for activate/deactivateEndpint
protected  javax.resource.spi.ActivationSpec activationSpec
          The activation spec
protected  MessageDrivenContainer container
          Our container
protected  String[] createActivationSpecSig
          The signature for createActivationSpec
protected  AtomicBoolean deliveryActive
          Whether delivery is active
protected  ArrayList<Class<?>> interceptors
          The interceptors
protected  Class<?>[] interfaces
          The interfaces
protected  String invokerBinding
          The invoker binding
protected  org.jboss.metadata.InvokerProxyBindingMetaData invokerMetaData
          The invoker meta data
protected  Class<?> messagingTypeClass
          The messaging type class
protected  org.jboss.metadata.MessageDrivenMetaData metaData
          Our meta data
protected  AtomicInteger nextProxyId
          The next proxy id
protected  HashMap<String,org.jboss.metadata.ActivationConfigPropertyMetaData> properties
          The activation properties
protected  GenericProxyFactory proxyFactory
          The proxy factory
protected  String resourceAdapterName
          The resource adapter name
protected  ObjectName resourceAdapterObjectName
          The resource adapter object name
protected  boolean trace
          Whether trace is enabled
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
log, server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.ejb.AllowedOperationsFlags
IN_AFTER_BEGIN, IN_AFTER_COMPLETION, IN_BEFORE_COMPLETION, IN_BUSINESS_METHOD, IN_EJB_ACTIVATE, IN_EJB_CREATE, IN_EJB_FIND, IN_EJB_HOME, IN_EJB_LOAD, IN_EJB_PASSIVATE, IN_EJB_POST_CREATE, IN_EJB_REMOVE, IN_EJB_STORE, IN_EJB_TIMEOUT, IN_INTERCEPTOR_METHOD, IN_SERVICE_ENDPOINT_METHOD, IN_SET_ENTITY_CONTEXT, IN_SET_MESSAGE_DRIVEN_CONTEXT, IN_SET_SESSION_CONTEXT, IN_UNSET_ENTITY_CONTEXT, NOT_ALLOWED
 
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
JBossMessageEndpointFactory()
           
 
Method Summary
protected  void activate()
          Activate
protected  void augmentActivationConfigProperties()
          Add activation config properties
protected  void createActivationSpec()
          Create the activation spec
 javax.resource.spi.endpoint.MessageEndpoint createEndpoint(XAResource resource)
           
protected  void deactivate()
          Deactivate
 String getConfig()
          Display the configuration
 MessageDrivenContainer getContainer()
          Get the message driven container
 boolean getDeliveryActive()
          Get whether delivery is active
 Object getEJBHome()
          This method is called whenever the EJBHome implementation for this container is needed.
 javax.ejb.EJBMetaData getEJBMetaData()
          This method is called whenever the metadata for this container is needed.
 Collection getEntityCollection(Collection collection)
          This method is called whenever a collection of EJBObjects for a collection of primary keys is needed.
 Object getEntityEJBObject(Object id)
          This method is called whenever an EJBObject implementation for an entitybean is needed.
 Object getStatefulSessionEJBObject(Object id)
          This method is called whenever an EJBObject implementation for a stateful session bean is needed.
 Object getStatelessSessionEJBObject()
          This method is called whenever an EJBObject implementation for a stateless session bean is needed.
 boolean isDeliveryTransacted(Method method)
           
 boolean isIdentical(Container container, Invocation mi)
          Protocol specific isIdentical implementation
protected  void resolveMessageListener()
          Resolve message listener class
protected  void resolveResourceAdapter()
          Resolve the resource adapter
protected  String resolveResourceAdapterName()
          Resolve the resource adapter name
 void setContainer(Container container)
          Set the container for which this is an invoker to.
 void setDeliveryActive(boolean active)
           
 void setInvokerBinding(String binding)
          Set the invoker jndi binding
 void setInvokerMetaData(org.jboss.metadata.InvokerProxyBindingMetaData imd)
          Set the invoker meta data so that the ProxyFactory can initialize properly
protected  void setupProxyParameters()
          Set up the proxy parametrs
 void startDelivery()
          Start delivery
protected  void startService()
           
 void stopDelivery()
          Stop delivery synchronously
 void stopDelivery(boolean asynch)
          Stop delivery synchronously
protected  void stopService()
           
 String toString()
          Return a string representation of the current config state.
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, 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, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getName, getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Field Detail

trace

protected boolean trace
Whether trace is enabled


container

protected MessageDrivenContainer container
Our container


metaData

protected org.jboss.metadata.MessageDrivenMetaData metaData
Our meta data


invokerBinding

protected String invokerBinding
The invoker binding


invokerMetaData

protected org.jboss.metadata.InvokerProxyBindingMetaData invokerMetaData
The invoker meta data


properties

protected HashMap<String,org.jboss.metadata.ActivationConfigPropertyMetaData> properties
The activation properties


proxyFactory

protected GenericProxyFactory proxyFactory
The proxy factory


messagingTypeClass

protected Class<?> messagingTypeClass
The messaging type class


resourceAdapterName

protected String resourceAdapterName
The resource adapter name


resourceAdapterObjectName

protected ObjectName resourceAdapterObjectName
The resource adapter object name


activationSpec

protected javax.resource.spi.ActivationSpec activationSpec
The activation spec


interceptors

protected ArrayList<Class<?>> interceptors
The interceptors


interfaces

protected Class<?>[] interfaces
The interfaces


nextProxyId

protected AtomicInteger nextProxyId
The next proxy id


deliveryActive

protected AtomicBoolean deliveryActive
Whether delivery is active


createActivationSpecSig

protected String[] createActivationSpecSig
The signature for createActivationSpec


activationSig

protected String[] activationSig
The signature for activate/deactivateEndpint

Constructor Detail

JBossMessageEndpointFactory

public JBossMessageEndpointFactory()
Method Detail

getContainer

public MessageDrivenContainer getContainer()
Get the message driven container

Returns:
the container

getConfig

public String getConfig()
Description copied from interface: JBossMessageEndpointFactoryMBean
Display the configuration

Specified by:
getConfig in interface JBossMessageEndpointFactoryMBean
Returns:
the configuration

createEndpoint

public javax.resource.spi.endpoint.MessageEndpoint createEndpoint(XAResource resource)
                                                           throws javax.resource.spi.UnavailableException
Specified by:
createEndpoint in interface javax.resource.spi.endpoint.MessageEndpointFactory
Throws:
javax.resource.spi.UnavailableException

isDeliveryTransacted

public boolean isDeliveryTransacted(Method method)
                             throws NoSuchMethodException
Specified by:
isDeliveryTransacted in interface javax.resource.spi.endpoint.MessageEndpointFactory
Throws:
NoSuchMethodException

startService

protected void startService()
                     throws Exception
Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

isIdentical

public boolean isIdentical(Container container,
                           Invocation mi)
Description copied from interface: EJBProxyFactory
Protocol specific isIdentical implementation

Specified by:
isIdentical in interface EJBProxyFactory
Parameters:
container - the container
mi - the invocation
Returns:
true when identical, false otherwise

getEJBHome

public Object getEJBHome()
Description copied from interface: EJBProxyFactory
This method is called whenever the EJBHome implementation for this container is needed.

Specified by:
getEJBHome in interface EJBProxyFactory
Returns:
An implementation of the home interface for this container.

getEJBMetaData

public javax.ejb.EJBMetaData getEJBMetaData()
Description copied from interface: EJBProxyFactory
This method is called whenever the metadata for this container is needed.

Specified by:
getEJBMetaData in interface EJBProxyFactory
Returns:
An implementation of the EJBMetaData interface.

getEntityCollection

public Collection getEntityCollection(Collection collection)
Description copied from interface: EJBProxyFactory
This method is called whenever a collection of EJBObjects for a collection of primary keys is needed.

Specified by:
getEntityCollection in interface EJBProxyFactory
Parameters:
collection - Enumeration of primary keys.
Returns:
A collection of EJBObjects implementing the remote interface for this container.

getEntityEJBObject

public Object getEntityEJBObject(Object id)
Description copied from interface: EJBProxyFactory
This method is called whenever an EJBObject implementation for an entitybean is needed.

Specified by:
getEntityEJBObject in interface EJBProxyFactory
Specified by:
getEntityEJBObject in interface GenericEntityObjectFactory
Parameters:
id - The primary key of the entity.
Returns:
An implementation of the remote interface for this container.

getStatefulSessionEJBObject

public Object getStatefulSessionEJBObject(Object id)
Description copied from interface: EJBProxyFactory
This method is called whenever an EJBObject implementation for a stateful session bean is needed.

Specified by:
getStatefulSessionEJBObject in interface EJBProxyFactory
Parameters:
id - The id of the session.
Returns:
An implementation of the remote interface for this container.

getStatelessSessionEJBObject

public Object getStatelessSessionEJBObject()
Description copied from interface: EJBProxyFactory
This method is called whenever an EJBObject implementation for a stateless session bean is needed.

Specified by:
getStatelessSessionEJBObject in interface EJBProxyFactory
Returns:
An implementation of the remote interface for this container.

setInvokerBinding

public void setInvokerBinding(String binding)
Description copied from interface: EJBProxyFactory
Set the invoker jndi binding

Specified by:
setInvokerBinding in interface EJBProxyFactory

setInvokerMetaData

public void setInvokerMetaData(org.jboss.metadata.InvokerProxyBindingMetaData imd)
Description copied from interface: EJBProxyFactory
Set the invoker meta data so that the ProxyFactory can initialize properly

Specified by:
setInvokerMetaData in interface EJBProxyFactory

setContainer

public void setContainer(Container container)
Set the container for which this is an invoker to.

Specified by:
setContainer in interface ContainerPlugin
Parameters:
container - The container for which this is an invoker to.

toString

public String toString()
Return a string representation of the current config state.

Overrides:
toString in class Object

resolveMessageListener

protected void resolveMessageListener()
                               throws DeploymentException
Resolve message listener class

Throws:
DeploymentException - for any error

resolveResourceAdapterName

protected String resolveResourceAdapterName()
                                     throws DeploymentException
Resolve the resource adapter name

Returns:
the resource adapter name
Throws:
DeploymentException - for any error

resolveResourceAdapter

protected void resolveResourceAdapter()
                               throws DeploymentException
Resolve the resource adapter

Throws:
DeploymentException - for any error

setupProxyParameters

protected void setupProxyParameters()
                             throws DeploymentException
Set up the proxy parametrs

Throws:
DeploymentException

augmentActivationConfigProperties

protected void augmentActivationConfigProperties()
                                          throws DeploymentException
Add activation config properties

Throws:
DeploymentException - for any error

createActivationSpec

protected void createActivationSpec()
                             throws DeploymentException
Create the activation spec

Throws:
DeploymentException - for any error

startDelivery

public void startDelivery()
                   throws Exception
Description copied from interface: JBossMessageEndpointFactoryMBean
Start delivery

Specified by:
startDelivery in interface JBossMessageEndpointFactoryMBean
Throws:
Exception - for any error

stopDelivery

public void stopDelivery()
                  throws Exception
Description copied from interface: JBossMessageEndpointFactoryMBean
Stop delivery synchronously

Specified by:
stopDelivery in interface JBossMessageEndpointFactoryMBean
Throws:
Exception - for any error

stopDelivery

public void stopDelivery(boolean asynch)
                  throws Exception
Description copied from interface: JBossMessageEndpointFactoryMBean
Stop delivery synchronously

Specified by:
stopDelivery in interface JBossMessageEndpointFactoryMBean
Parameters:
asynch - whether to stop delivery asynchronously
Throws:
Exception - for any error

getDeliveryActive

public boolean getDeliveryActive()
Description copied from interface: JBossMessageEndpointFactoryMBean
Get whether delivery is active

Specified by:
getDeliveryActive in interface JBossMessageEndpointFactoryMBean
Returns:
true when active

setDeliveryActive

public void setDeliveryActive(boolean active)

activate

protected void activate()
                 throws DeploymentException
Activate

Throws:
DeploymentException - for any error

deactivate

protected void deactivate()
Deactivate



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