Search in sources :

Example 6 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method messageLossAndRecovery.

/**
 * Send a messageLossAndRecovery request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void messageLossAndRecovery(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendMessageLossAndRecovery(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 7 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method cannotComplete.

/**
 * Send a cannotComplete request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void cannotComplete(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendCannotComplete(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 8 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method exit.

/**
 * Send a exit request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void exit(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendExit(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 9 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method unsolicitedComplete.

/**
 * Send a unsolicitedComplete request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void unsolicitedComplete(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendUnsolicitedComplete(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 10 with BAInitiatorProcessor

use of com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method compensationFail.

/**
 * Send a compensationFail request.
 * @param serviceURI The target service URI.
 * @param coordinationContext The coordination context.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void compensationFail(final String serviceURI, final CoordinationContextType coordinationContext) throws SoapFault, IOException {
    final String messageId = MessageId.getMessageId();
    final MAP map = AddressingHelper.createRequestContext(serviceURI, messageId);
    final RequestCallback callback = new RequestCallback();
    final BAInitiatorProcessor initiator = BAInitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendCompensationFail(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : BAInitiatorProcessor(com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

BAInitiatorProcessor (com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor)12 MAP (org.jboss.ws.api.addressing.MAP)12