Search in sources :

Example 1 with MessageEndpoint

use of jakarta.resource.spi.endpoint.MessageEndpoint in project spring-framework by spring-projects.

the class GenericMessageEndpointFactory method createEndpoint.

/**
 * 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.
 */
@Override
public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
    GenericMessageEndpoint endpoint = (GenericMessageEndpoint) super.createEndpoint(xaResource);
    ProxyFactory proxyFactory = new ProxyFactory(getMessageListener());
    DelegatingIntroductionInterceptor introduction = new DelegatingIntroductionInterceptor(endpoint);
    introduction.suppressInterface(MethodInterceptor.class);
    proxyFactory.addAdvice(introduction);
    return (MessageEndpoint) proxyFactory.getProxy();
}
Also used : DelegatingIntroductionInterceptor(org.springframework.aop.support.DelegatingIntroductionInterceptor) MessageEndpoint(jakarta.resource.spi.endpoint.MessageEndpoint) ProxyFactory(org.springframework.aop.framework.ProxyFactory)

Aggregations

MessageEndpoint (jakarta.resource.spi.endpoint.MessageEndpoint)1 ProxyFactory (org.springframework.aop.framework.ProxyFactory)1 DelegatingIntroductionInterceptor (org.springframework.aop.support.DelegatingIntroductionInterceptor)1