Search in sources :

Example 6 with InitiatorProcessor

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

the class AsyncParticipantStub method lostCommitted.

/**
 * Send a lostCommitted 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 lostCommitted(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().sendLostCommitted(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 7 with InitiatorProcessor

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

the class AsyncParticipantStub method volatileAndDurable.

/**
 * Send a volatileAndDurable 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 volatileAndDurable(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().sendVolatileAndDurable(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 8 with InitiatorProcessor

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

the class AsyncParticipantStub method completionCommit.

/**
 * Send a completion commit request.
 * @param serviceURI The target service URI.
 * @param coordinatorURI The coordinator URI.
 * @throws SoapFault For any errors.
 * @throws IOException for any transport errors.
 */
public void completionCommit(final String serviceURI, final String coordinatorURI) 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().sendCompletionCommit(map, coordinatorURI);
        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 9 with InitiatorProcessor

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

the class AsyncParticipantStub method retryPreparedCommit.

/**
 * Send a retryPreparedCommit 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 retryPreparedCommit(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().sendRetryPreparedCommit(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 10 with InitiatorProcessor

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

the class AsyncParticipantStub method readonly.

/**
 * Send a readonly 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 readonly(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().sendReadonly(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