Class ImportWildflyClientGlobalTransactionFilter

java.lang.Object
org.wildfly.extension.rts.jaxrs.ImportWildflyClientGlobalTransactionFilter
All Implemented Interfaces:
jakarta.ws.rs.container.ContainerRequestFilter, jakarta.ws.rs.container.ContainerResponseFilter

@Provider @Priority(4920) public class ImportWildflyClientGlobalTransactionFilter extends Object implements jakarta.ws.rs.container.ContainerRequestFilter, jakarta.ws.rs.container.ContainerResponseFilter

Request and response filter which is expected to be called for the request side after the InboundBridgeFilter is processed while on the response side before the InboundBridgeFilter is processed.

Purpose of this filter is an integration of WFTC with Narayana REST-AT Inbound Bridge. Inbound Bridge uses Narayana transactions while WFLY utilizes WFTC transactions (wrapping the underlaying Narayana) ones. For that on request side the Inbound bridge first creates the Narayana transaction and then the request filter makes the WFTC to wrap and to know about this transaction. On the response side the WFTC needs to suspend its wrapping transaction and then Narayana suspend its own transaction (which was already suspended by WFTC callback and thus is ignored on the Narayana side).

The InboundBridgeFilter defines its Priority as Priorities#USER-100. This WildFly filter has to be processed after the Narayana one and it needs to define higher priority.

Author:
Ondrej Chaloupka <ochaloup@redhat.com>
  • Constructor Details

    • ImportWildflyClientGlobalTransactionFilter

      public ImportWildflyClientGlobalTransactionFilter()
  • Method Details

    • filter

      public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext) throws IOException
      Specified by:
      filter in interface jakarta.ws.rs.container.ContainerRequestFilter
      Throws:
      IOException
    • filter

      public void filter(jakarta.ws.rs.container.ContainerRequestContext requestContext, jakarta.ws.rs.container.ContainerResponseContext responseContext) throws IOException
      Specified by:
      filter in interface jakarta.ws.rs.container.ContainerResponseFilter
      Throws:
      IOException