protected abstract class AbstractMessageEndpointFactory.AbstractMessageEndpoint
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
beforeDeliveryCalled |
private java.lang.ClassLoader |
previousContextClassLoader |
private AbstractMessageEndpointFactory.TransactionDelegate |
transactionDelegate |
Modifier | Constructor and Description |
---|---|
protected |
AbstractMessageEndpoint() |
Modifier and Type | Method and Description |
---|---|
void |
afterDelivery()
This
afterDelivery implementation resets the thread context
ClassLoader and completes the transaction, if any. |
void |
beforeDelivery(java.lang.reflect.Method method)
This
beforeDelivery implementation starts a transaction,
if necessary, and exposes the endpoint ClassLoader as current
thread context ClassLoader. |
protected abstract java.lang.ClassLoader |
getEndpointClassLoader()
Template method for exposing the endpoint's ClassLoader
(typically the ClassLoader that the message listener class
has been loaded with).
|
protected boolean |
hasBeforeDeliveryBeenCalled()
Return whether the
beforeDelivery(java.lang.reflect.Method) method of this endpoint
has already been called. |
(package private) void |
initXAResource(javax.transaction.xa.XAResource xaResource)
Initialize this endpoint's TransactionDelegate.
|
protected void |
onEndpointException(java.lang.Throwable ex)
Callback method for notifying the endpoint base class
that the concrete endpoint invocation led to an exception.
|
void |
release() |
private AbstractMessageEndpointFactory.TransactionDelegate transactionDelegate
private boolean beforeDeliveryCalled
private java.lang.ClassLoader previousContextClassLoader
void initXAResource(javax.transaction.xa.XAResource xaResource)
xaResource
- the XAResource for this endpointpublic void beforeDelivery(java.lang.reflect.Method method) throws ResourceException
beforeDelivery
implementation starts a transaction,
if necessary, and exposes the endpoint ClassLoader as current
thread context ClassLoader.
Note that the JCA 1.5 specification does not require a ResourceAdapter
to call this method before invoking the concrete endpoint. If this method
has not been called (check hasBeforeDeliveryBeenCalled()
), the
concrete endpoint method should call beforeDelivery
and its
sibling afterDelivery()
explicitly, as part of its own processing.
ResourceException
protected abstract java.lang.ClassLoader getEndpointClassLoader()
null
)protected final boolean hasBeforeDeliveryBeenCalled()
beforeDelivery(java.lang.reflect.Method)
method of this endpoint
has already been called.protected final void onEndpointException(java.lang.Throwable ex)
To be invoked by subclasses in case of the concrete endpoint throwing an exception.
ex
- the exception thrown from the concrete endpointpublic void afterDelivery() throws ResourceException
afterDelivery
implementation resets the thread context
ClassLoader and completes the transaction, if any.
Note that the JCA 1.5 specification does not require a ResourceAdapter
to call this method after invoking the concrete endpoint. See the
explanation in beforeDelivery(java.lang.reflect.Method)
's javadoc.
ResourceException
public void release()