org.jboss.ejb3.mdb.inflow
Class MessageInflowLocalProxy

java.lang.Object
  extended by org.jboss.ejb3.mdb.inflow.MessageInflowLocalProxy
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public class MessageInflowLocalProxy
extends java.lang.Object
implements java.lang.reflect.InvocationHandler


Field Summary
protected  boolean delivered
          Whether we have delivered a message
protected  java.lang.Thread inUseThread
          The in use thread
static java.lang.String MESSAGE_ENDPOINT_FACTORY
          The key for the factory
static java.lang.String MESSAGE_ENDPOINT_XARESOURCE
          The key for the xa resource
protected  java.lang.ClassLoader oldClassLoader
          The old classloader of the thread
protected  java.util.concurrent.atomic.AtomicBoolean released
          Whether this proxy has been released
protected  javax.transaction.Transaction suspended
          Any suspended transaction
protected  javax.transaction.Transaction transaction
          Any transaction we started
 
Constructor Summary
protected MessageInflowLocalProxy(MessagingContainer container)
           
 
Method Summary
protected  void after(java.lang.Object proxy)
          After delivery processing.
protected  void before(java.lang.Object proxy, MessagingContainer container, java.lang.reflect.Method method, java.lang.Object[] args)
          Before delivery processing.
protected  java.lang.Object delivery(java.lang.Object proxy, MessagingContainer container, java.lang.reflect.Method method, java.lang.Object[] args)
          Delivery.
protected  void endTransaction(java.lang.Object proxy, boolean commit)
          End the transaction
protected  void finish(java.lang.String context, java.lang.Object proxy, boolean commit)
          Finish the current delivery
protected  MessagingContainer getContainer(org.jboss.aop.joinpoint.Invocation mi)
          Get the container
protected  JBossMessageEndpointFactory getMessageEndpointFactory(org.jboss.aop.joinpoint.Invocation invocation)
          Get the message endpoint factory
protected  java.lang.String getProxyString(java.lang.Object proxy)
          Get our proxy's string value.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
protected  void release(java.lang.Object proxy)
          Release this message endpoint.
protected  void releaseThreadLock(java.lang.Object proxy)
          Release the thread lock
protected  void resetContextClassLoader(java.lang.Object proxy)
          Reset the context classloader
 void setMessageEndpointFactory(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory)
           
 void setXaResource(javax.transaction.xa.XAResource resource)
           
protected  void startTransaction(java.lang.String context, java.lang.Object proxy, MessagingContainer container, java.lang.reflect.Method m, java.lang.Object[] args, boolean isTransacted)
          Start a transaction
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MESSAGE_ENDPOINT_FACTORY

public static final java.lang.String MESSAGE_ENDPOINT_FACTORY
The key for the factory

See Also:
Constant Field Values

MESSAGE_ENDPOINT_XARESOURCE

public static final java.lang.String MESSAGE_ENDPOINT_XARESOURCE
The key for the xa resource

See Also:
Constant Field Values

released

protected java.util.concurrent.atomic.AtomicBoolean released
Whether this proxy has been released


delivered

protected boolean delivered
Whether we have delivered a message


inUseThread

protected java.lang.Thread inUseThread
The in use thread


oldClassLoader

protected java.lang.ClassLoader oldClassLoader
The old classloader of the thread


transaction

protected javax.transaction.Transaction transaction
Any transaction we started


suspended

protected javax.transaction.Transaction suspended
Any suspended transaction

Constructor Detail

MessageInflowLocalProxy

protected MessageInflowLocalProxy(MessagingContainer container)
Method Detail

setMessageEndpointFactory

public void setMessageEndpointFactory(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory)

setXaResource

public void setXaResource(javax.transaction.xa.XAResource resource)

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable
Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

release

protected void release(java.lang.Object proxy)
                throws java.lang.Throwable
Release this message endpoint.

Parameters:
mi - the invocation
Throws:
java.lang.Throwable - for any error

before

protected void before(java.lang.Object proxy,
                      MessagingContainer container,
                      java.lang.reflect.Method method,
                      java.lang.Object[] args)
               throws java.lang.Throwable
Before delivery processing.

Parameters:
mi - the invocation
Throws:
java.lang.Throwable - for any error

after

protected void after(java.lang.Object proxy)
              throws java.lang.Throwable
After delivery processing.

Parameters:
mi - the invocation
Throws:
java.lang.Throwable - for any error

delivery

protected java.lang.Object delivery(java.lang.Object proxy,
                                    MessagingContainer container,
                                    java.lang.reflect.Method method,
                                    java.lang.Object[] args)
                             throws java.lang.Throwable
Delivery.

Parameters:
mi - the invocation
Returns:
the result of the delivery
Throws:
java.lang.Throwable - for any error

finish

protected void finish(java.lang.String context,
                      java.lang.Object proxy,
                      boolean commit)
               throws java.lang.Throwable
Finish the current delivery

Parameters:
context - the lifecycle method
mi - the invocation
commit - whether to commit
Throws:
java.lang.Throwable - for any error

startTransaction

protected void startTransaction(java.lang.String context,
                                java.lang.Object proxy,
                                MessagingContainer container,
                                java.lang.reflect.Method m,
                                java.lang.Object[] args,
                                boolean isTransacted)
                         throws java.lang.Throwable
Start a transaction

Parameters:
context - the lifecycle method
mi - the invocation
container - the container
Throws:
java.lang.Throwable - for any error

endTransaction

protected void endTransaction(java.lang.Object proxy,
                              boolean commit)
                       throws java.lang.Throwable
End the transaction

Parameters:
mi - the invocation
commit - whether to try to commit
Throws:
java.lang.Throwable - for any error

resetContextClassLoader

protected void resetContextClassLoader(java.lang.Object proxy)
Reset the context classloader

Parameters:
mi - the invocation

releaseThreadLock

protected void releaseThreadLock(java.lang.Object proxy)
Release the thread lock

Parameters:
mi - the invocation

getProxyString

protected java.lang.String getProxyString(java.lang.Object proxy)
Get our proxy's string value.

Parameters:
mi - the invocation
Returns:
the string

getMessageEndpointFactory

protected JBossMessageEndpointFactory getMessageEndpointFactory(org.jboss.aop.joinpoint.Invocation invocation)
Get the message endpoint factory

Returns:
the message endpoint factory

getContainer

protected MessagingContainer getContainer(org.jboss.aop.joinpoint.Invocation mi)
Get the container

Returns:
the container