Class GenericMessageEndpointFactory

java.lang.Object
org.springframework.jca.endpoint.AbstractMessageEndpointFactory
org.springframework.jca.endpoint.GenericMessageEndpointFactory
All Implemented Interfaces:
jakarta.resource.spi.endpoint.MessageEndpointFactory, Aware, BeanNameAware

public class GenericMessageEndpointFactory extends AbstractMessageEndpointFactory
Generic implementation of the JCA 1.7 MessageEndpointFactory interface, providing transaction management capabilities for any kind of message listener object (for example, MessageListener objects or MessageListener objects).

Uses AOP proxies for concrete endpoint instances, simply wrapping the specified message listener object and exposing all of its implemented interfaces on the endpoint instance.

Typically used with Spring's GenericMessageEndpointManager, but not tied to it. As a consequence, this endpoint factory could also be used with programmatic endpoint management on a native ResourceAdapter instance.

Since:
2.5
Author:
Juergen Hoeller
See Also:
  • Constructor Details

    • GenericMessageEndpointFactory

      public GenericMessageEndpointFactory()
  • Method Details

    • setMessageListener

      public void setMessageListener(Object messageListener)
      Specify the message listener object that the endpoint should expose (for example, a MessageListener objects or MessageListener implementation).
    • getMessageListener

      protected Object getMessageListener()
      Return the message listener object for this endpoint.
      Since:
      5.0
    • createEndpoint

      public jakarta.resource.spi.endpoint.MessageEndpoint createEndpoint(XAResource xaResource) throws jakarta.resource.spi.UnavailableException
      Wrap each concrete endpoint instance with an AOP proxy, exposing the message listener's interfaces as well as the endpoint SPI through an AOP introduction.
      Specified by:
      createEndpoint in interface jakarta.resource.spi.endpoint.MessageEndpointFactory
      Overrides:
      createEndpoint in class AbstractMessageEndpointFactory
      Throws:
      jakarta.resource.spi.UnavailableException
    • createEndpointInternal

      protected AbstractMessageEndpointFactory.AbstractMessageEndpoint createEndpointInternal() throws jakarta.resource.spi.UnavailableException
      Creates a concrete generic message endpoint, internal to this factory.
      Specified by:
      createEndpointInternal in class AbstractMessageEndpointFactory
      Returns:
      the actual endpoint instance (never null)
      Throws:
      jakarta.resource.spi.UnavailableException - if no endpoint is available at present