Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.jca.endpoint
Class AbstractMessageEndpointFactory.AbstractMessageEndpoint

    java.lang.Object
      org.springframework.jca.endpoint.AbstractMessageEndpointFactory.AbstractMessageEndpoint

All Implemented Interfaces:
  javax.resource.spi.endpoint.MessageEndpoint

Enclosing class:
  AbstractMessageEndpointFactory

    protected abstract class AbstractMessageEndpointFactory.AbstractMessageEndpoint

extends java.lang.Object
implements javax.resource.spi.endpoint.MessageEndpoint

Inner class for actual endpoint implementations, based on template method to allow for any kind of concrete endpoint implementation.

Constructor Summary
`protected` | `AbstractMessageEndpointFactory.AbstractMessageEndpoint()`

Method Summary
`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.
`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()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### AbstractMessageEndpointFactory.AbstractMessageEndpoint

    protected AbstractMessageEndpointFactory.AbstractMessageEndpoint()

Method Detail

### beforeDelivery

    public void beforeDelivery(java.lang.reflect.Method method)
                        throws javax.resource.ResourceException

  This `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.

  Specified by:
    `beforeDelivery` in interface `javax.resource.spi.endpoint.MessageEndpoint`
  Throws:
    `javax.resource.ResourceException`

### getEndpointClassLoader

    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).

  Returns:
    the endpoint ClassLoader (never `null`)

### hasBeforeDeliveryBeenCalled

    protected final boolean hasBeforeDeliveryBeenCalled()

  Return whether the `beforeDelivery(java.lang.reflect.Method)` method of this endpoint has already been called.

### onEndpointException

    protected final void onEndpointException(java.lang.Throwable ex)

  Callback method for notifying the endpoint base class that the concrete endpoint invocation led to an exception.

  To be invoked by subclasses in case of the concrete endpoint throwing an exception.

  Parameters:
    `ex` - the exception thrown from the concrete endpoint

### afterDelivery

    public void afterDelivery()
                       throws javax.resource.ResourceException

  This `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.

  Specified by:
    `afterDelivery` in interface `javax.resource.spi.endpoint.MessageEndpoint`
  Throws:
    `javax.resource.ResourceException`

### release

    public void release()

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

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD