Class ImportWildflyClientGlobalTransactionFilter

  • All Implemented Interfaces:
    javax.ws.rs.container.ContainerRequestFilter, javax.ws.rs.container.ContainerResponseFilter

    @Provider
    @Priority(4920)
    public class ImportWildflyClientGlobalTransactionFilter
    extends Object
    implements javax.ws.rs.container.ContainerRequestFilter, javax.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
    • Constructor Detail

      • ImportWildflyClientGlobalTransactionFilter

        public ImportWildflyClientGlobalTransactionFilter()
    • Method Detail

      • filter

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

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