Search in sources :

Example 6 with ParticipantPortType

use of com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType in project narayana by jbosstm.

the class AsyncParticipantClient method sendCannotComplete.

/**
 * Send a cannot complete request.
 * @param coordinationContext The coordination context.
 * @param map The addressing context initialised with to, message ID and relates to.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void sendCannotComplete(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault, IOException {
    map.setReplyTo(initiator);
    ParticipantPortType port = BAInteropClient.getParticipantPort(map, cannotCompleteAction);
    CoordinationContextManager.setThreadContext(coordinationContext);
    try {
        port.cannotComplete();
    } finally {
        CoordinationContextManager.setThreadContext(null);
    }
}
Also used : ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType)

Example 7 with ParticipantPortType

use of com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType in project narayana by jbosstm.

the class AsyncParticipantClient method sendCompensate.

/**
 * Send a compensate request.
 * @param coordinationContext The coordination context.
 * @param map The addressing context initialised with to, message ID and relates to.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void sendCompensate(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault, IOException {
    map.setReplyTo(initiator);
    ParticipantPortType port = BAInteropClient.getParticipantPort(map, compensateAction);
    CoordinationContextManager.setThreadContext(coordinationContext);
    try {
        port.compensate();
    } finally {
        CoordinationContextManager.setThreadContext(null);
    }
}
Also used : ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType)

Example 8 with ParticipantPortType

use of com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType in project narayana by jbosstm.

the class BAInteropClient method getParticipantPort.

// don't think we ever need this as we get a registration port from the endpoint ref returned by
// the activation port request
public static ParticipantPortType getParticipantPort(MAP map, String action) {
    ParticipantService service = getParticipantService();
    ParticipantPortType port = service.getPort(ParticipantPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    List<Handler> customHandlerChain = new ArrayList<Handler>();
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
		customHandlerChain.add(new WSAddressingClientHandler());
         */
    /*
         * we need to add the coordination context handler in the case where we are passing a
         * coordination context via a header element
         */
    customHandlerChain.add(new CoordinationContextHandler());
    bindingProvider.getBinding().setHandlerChain(customHandlerChain);
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    map.setAction(action);
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : ParticipantService(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantService) AddressingFeature(javax.xml.ws.soap.AddressingFeature) ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) ArrayList(java.util.ArrayList) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider)

Example 9 with ParticipantPortType

use of com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType in project narayana by jbosstm.

the class AsyncParticipantClient method sendExit.

/**
 * Send a exit request.
 * @param coordinationContext The coordination context.
 * @param map The addressing context initialised with to, message ID and relates to.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void sendExit(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault, IOException {
    map.setReplyTo(initiator);
    ParticipantPortType port = BAInteropClient.getParticipantPort(map, exitAction);
    CoordinationContextManager.setThreadContext(coordinationContext);
    try {
        port.exit();
    } finally {
        CoordinationContextManager.setThreadContext(null);
    }
}
Also used : ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType)

Example 10 with ParticipantPortType

use of com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType in project narayana by jbosstm.

the class AsyncParticipantClient method sendParticipantCompleteClose.

/**
 * Send a participant complete close request.
 * @param coordinationContext The coordination context.
 * @param map The addressing context initialised with to, message ID and relates to.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void sendParticipantCompleteClose(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault, IOException {
    map.setReplyTo(initiator);
    ParticipantPortType port = BAInteropClient.getParticipantPort(map, participantCompleteCloseAction);
    CoordinationContextManager.setThreadContext(coordinationContext);
    try {
        port.participantCompleteClose();
    } finally {
        CoordinationContextManager.setThreadContext(null);
    }
}
Also used : ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType)

Aggregations

ParticipantPortType (com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType)13 ParticipantService (com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantService)1 CoordinationContextHandler (com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler)1 ArrayList (java.util.ArrayList)1 BindingProvider (javax.xml.ws.BindingProvider)1 Handler (javax.xml.ws.handler.Handler)1 AddressingFeature (javax.xml.ws.soap.AddressingFeature)1