Search in sources :

Example 1 with InitiatorProcessor

use of com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method commit.

/**
 * Send a commit 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 commit(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 InitiatorProcessor initiator = InitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendCommit(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : InitiatorProcessor(com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 2 with InitiatorProcessor

use of com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method phase2Rollback.

/**
 * Send a phase2Rollback 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 phase2Rollback(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 InitiatorProcessor initiator = InitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendPhase2Rollback(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : InitiatorProcessor(com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 3 with InitiatorProcessor

use of com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method retryPreparedAbort.

/**
 * Send a retryPreparedAbort 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 retryPreparedAbort(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 InitiatorProcessor initiator = InitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendRetryPreparedAbort(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : InitiatorProcessor(com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 4 with InitiatorProcessor

use of com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method rollback.

/**
 * Send a rollback 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 rollback(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 InitiatorProcessor initiator = InitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendRollback(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : InitiatorProcessor(com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Example 5 with InitiatorProcessor

use of com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor in project narayana by jbosstm.

the class AsyncParticipantStub method retryCommit.

/**
 * Send a retryCommit 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 retryCommit(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 InitiatorProcessor initiator = InitiatorProcessor.getInitiator();
    initiator.registerCallback(messageId, callback);
    try {
        AsyncParticipantClient.getClient().sendRetryCommit(coordinationContext, map);
        callback.waitUntilTriggered(15000);
    } finally {
        initiator.removeCallback(messageId);
    }
    handleCallback(callback);
}
Also used : InitiatorProcessor(com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

InitiatorProcessor (com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor)15 MAP (org.jboss.ws.api.addressing.MAP)15