org.objectweb.easybeans.container.mdb
Class MDBMessageEndPoint

java.lang.Object
  extended by org.objectweb.easybeans.container.mdb.MDBMessageEndPoint
All Implemented Interfaces:
javax.resource.spi.endpoint.MessageEndpoint
Direct Known Subclasses:
MDBMessageListenerEndPoint

public class MDBMessageEndPoint
extends java.lang.Object
implements javax.resource.spi.endpoint.MessageEndpoint

Implementation of the MessageEndPoint interface.
These methods will be called by the Resource Adapter.

Author:
Florent Benoit

Field Summary
private  EasyBeansMDB easyBeansMDB
          MDB object Wrapped by this message end point.
private  MDBMessageEndPointFactory mdbMessageEndPointFactory
          Reference to the message end point factory.
private  javax.transaction.xa.XAResource xaResource
          XAResource of this message end point.
 
Constructor Summary
MDBMessageEndPoint(MDBMessageEndPointFactory mdbMessageEndPointFactory, EasyBeansMDB easyBeansMDB)
          Constructor : Build an endpoint with a reference to the message end point factory.
 
Method Summary
 void afterDelivery()
          This is called by a resource adapter after a message is delivered.
 void beforeDelivery(java.lang.reflect.Method method)
          This is called by a resource adapter before a message is delivered.
 Factory getEasyBeansFactory()
          Gets the factory of the bean.
 EasyBeansMDB getEasyBeansMDB()
          Gets the wrapped Message Driven Bean object.
protected  javax.transaction.xa.XAResource getXaResource()
          Gets the XAResource of this message end point.
 void release()
          This method may be called by the resource adapter to indicate that it no longer needs a proxy endpoint instance.
protected  void setXaResource(javax.transaction.xa.XAResource xaResource)
          Sets the XAResource of this message end point.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

easyBeansMDB

private EasyBeansMDB easyBeansMDB
MDB object Wrapped by this message end point.


mdbMessageEndPointFactory

private MDBMessageEndPointFactory mdbMessageEndPointFactory
Reference to the message end point factory.


xaResource

private javax.transaction.xa.XAResource xaResource
XAResource of this message end point. This resource will be enlisted/delisted.

Constructor Detail

MDBMessageEndPoint

public MDBMessageEndPoint(MDBMessageEndPointFactory mdbMessageEndPointFactory,
                          EasyBeansMDB easyBeansMDB)
Constructor : Build an endpoint with a reference to the message end point factory.

Parameters:
mdbMessageEndPointFactory - the message end point factory.
easyBeansMDB - the message driven bean object that is wrapped.
Method Detail

beforeDelivery

public void beforeDelivery(java.lang.reflect.Method method)
                    throws java.lang.NoSuchMethodException,
                           javax.resource.ResourceException
This is called by a resource adapter before a message is delivered.

Specified by:
beforeDelivery in interface javax.resource.spi.endpoint.MessageEndpoint
Parameters:
method - description of a target method. This information about the intended target method allows an application server to decide whether to start a transaction during this method call, depending on the transaction preferences of the target method. The processing (by the application server) of the actual message delivery method call on the endpoint must be independent of the class loader associated with this descriptive method object.
Throws:
java.lang.NoSuchMethodException - - indicates that the specified method does not exist on the target endpoint.
javax.resource.ResourceException - - generic exception.
ApplicationServerInternalException - - indicates an error condition in the application server.
java.lang.IllegalStateException - - indicates that the endpoint is in an illegal state for the method invocation. For example, this occurs when beforeDelivery and afterDelivery method calls are not paired.
UnavailableException - - indicates that the endpoint is not available.

afterDelivery

public void afterDelivery()
                   throws javax.resource.ResourceException
This is called by a resource adapter after a message is delivered.

Specified by:
afterDelivery in interface javax.resource.spi.endpoint.MessageEndpoint
Throws:
javax.resource.ResourceException - - generic exception.
ApplicationServerInternalException - - indicates an error condition in the application server.
java.lang.IllegalStateException - - indicates that the endpoint is in an illegal state for the method invocation. For example, this occurs when beforeDelivery and afterDelivery method calls are not paired.
UnavailableException - - indicates that the endpoint is not available.

release

public void release()
This method may be called by the resource adapter to indicate that it no longer needs a proxy endpoint instance. This hint may be used by the application server for endpoint pooling decisions.

Specified by:
release in interface javax.resource.spi.endpoint.MessageEndpoint

getEasyBeansFactory

public Factory getEasyBeansFactory()
Gets the factory of the bean.

Returns:
factory of the bean.

getEasyBeansMDB

public EasyBeansMDB getEasyBeansMDB()
Gets the wrapped Message Driven Bean object.

Returns:
wrapped Message Driven Bean object.

getXaResource

protected javax.transaction.xa.XAResource getXaResource()
Gets the XAResource of this message end point.

Returns:
the XAResource of this message end point

setXaResource

protected void setXaResource(javax.transaction.xa.XAResource xaResource)
Sets the XAResource of this message end point.

Parameters:
xaResource - the XAResource of this message end point