org.jboss.ejb3.mdb.inflow
Class MessageInflowLocalProxy

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

public class MessageInflowLocalProxy
extends Object
implements InvocationHandler

Version:
$Revision: 71999 $
Author:
William DeCoste

Field Summary
protected  boolean delivered
          Whether we have delivered a message
protected  Thread inUseThread
          The in use thread
static String MESSAGE_ENDPOINT_FACTORY
          The key for the factory
static String MESSAGE_ENDPOINT_XARESOURCE
          The key for the xa resource
protected  ClassLoader oldClassLoader
          The old classloader of the thread
protected  AtomicBoolean released
          Whether this proxy has been released
protected  Transaction suspended
          Any suspended transaction
protected  Transaction transaction
          Any transaction we started
 
Constructor Summary
protected MessageInflowLocalProxy(MessagingContainer container)
           
 
Method Summary
protected  void after(Object proxy)
          After delivery processing.
protected  void before(Object proxy, MessagingContainer container, Method method, Object[] args)
          Before delivery processing.
protected  Object delivery(Object proxy, MessagingContainer container, Method method, Object[] args)
          Delivery.
protected  void endTransaction(Object proxy, boolean commit)
          End the transaction
protected  void finish(String context, 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  String getProxyString(Object proxy)
          Get our proxy's string value.
 Object invoke(Object proxy, Method method, Object[] args)
           
protected  void release(Object proxy)
          Release this message endpoint.
protected  void releaseThreadLock(Object proxy)
          Release the thread lock
protected  void resetContextClassLoader(Object proxy)
          Reset the context classloader
 void setMessageEndpointFactory(javax.resource.spi.endpoint.MessageEndpointFactory messageEndpointFactory)
           
 void setXaResource(XAResource resource)
           
protected  void startTransaction(String context, Object proxy, MessagingContainer container, Method m, Object[] args, boolean isTransacted)
          Start a transaction
 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 String MESSAGE_ENDPOINT_FACTORY
The key for the factory

See Also:
Constant Field Values

MESSAGE_ENDPOINT_XARESOURCE

public static final String MESSAGE_ENDPOINT_XARESOURCE
The key for the xa resource

See Also:
Constant Field Values

released

protected AtomicBoolean released
Whether this proxy has been released


delivered

protected boolean delivered
Whether we have delivered a message


inUseThread

protected Thread inUseThread
The in use thread


oldClassLoader

protected ClassLoader oldClassLoader
The old classloader of the thread


transaction

protected Transaction transaction
Any transaction we started


suspended

protected 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(XAResource resource)

invoke

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

toString

public String toString()
Overrides:
toString in class Object

release

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

Parameters:
mi - the invocation
Throws:
Throwable - for any error

before

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

Parameters:
mi - the invocation
Throws:
Throwable - for any error

after

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

Parameters:
mi - the invocation
Throws:
Throwable - for any error

delivery

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

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

finish

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

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

startTransaction

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

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

endTransaction

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

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

resetContextClassLoader

protected void resetContextClassLoader(Object proxy)
Reset the context classloader

Parameters:
mi - the invocation

releaseThreadLock

protected void releaseThreadLock(Object proxy)
Release the thread lock

Parameters:
mi - the invocation

getProxyString

protected String getProxyString(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


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