Search in sources :

Example 81 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext in project narayana by jbosstm.

the class ParticipantEngine method prepare.

/**
 * Handle the prepare event.
 * @param prepare The prepare notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 *
 * None -> None (send aborted)
 * Active -> Preparing (execute prepare)
 * Preparing -> Preparing (do nothing)
 * PreparedSuccess -> PreparedSuccess (resend prepared)
 * Committing -> Committing (ignore)
 * Aborting -> Aborting (send aborted and forget)
 */
public void prepare(final Notification prepare, final MAP map, final ArjunaContext arjunaContext) {
    final State current;
    synchronized (this) {
        current = state;
        if (current == State.STATE_ACTIVE) {
            state = State.STATE_PREPARING;
        }
    }
    if (current == State.STATE_ACTIVE) {
        executePrepare();
    } else if (current == State.STATE_PREPARED_SUCCESS) {
        sendPrepared();
    } else if ((current == State.STATE_ABORTING) || (current == null)) {
        sendAborted();
        forget();
    }
}
Also used : State(com.arjuna.webservices11.wsat.State)

Example 82 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext in project narayana by jbosstm.

the class CoordinatorPortTypeImpl method preparedOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "PreparedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Prepared")
public void preparedOperation(@WebParam(name = "Prepared", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification prepared = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorProcessor.getProcessor().prepared(prepared, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 83 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext in project narayana by jbosstm.

the class CoordinatorPortTypeImpl method committedOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "CommittedOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/Committed")
public void committedOperation(@WebParam(name = "Committed", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification committed = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorProcessor.getProcessor().committed(committed, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 84 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext in project narayana by jbosstm.

the class CoordinatorPortTypeImpl method readOnlyOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "ReadOnlyOperation", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/ReadOnly")
public void readOnlyOperation(@WebParam(name = "ReadOnly", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters") Notification parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final Notification readOnly = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorProcessor.getProcessor().readOnly(readOnly, inboundMap, arjunaContext);
        }
    });
}
Also used : Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Notification(org.oasis_open.docs.ws_tx.wsat._2006._06.Notification) Action(javax.xml.ws.Action)

Example 85 with ArjunaContext

use of com.arjuna.webservices11.wsarj.ArjunaContext in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl method failOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
public void failOperation(@WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters") ExceptionType parameters) {
    if (WSTLogger.logger.isTraceEnabled()) {
        WSTLogger.logger.trace(getClass().getSimpleName() + ".failOperation");
    }
    MessageContext ctx = webServiceCtx.getMessageContext();
    final ExceptionType fail = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            ParticipantCompletionCoordinatorProcessor.getProcessor().fail(fail, inboundMap, arjunaContext);
        }
    });
}
Also used : ExceptionType(org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType) Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Action(javax.xml.ws.Action)

Aggregations

MAP (org.jboss.ws.api.addressing.MAP)95 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)83 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)74 MessageContext (javax.xml.ws.handler.MessageContext)68 Task (com.arjuna.services.framework.task.Task)62 Action (javax.xml.ws.Action)54 NotificationType (org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType)29 SoapFault (com.arjuna.webservices.SoapFault)17 Notification (org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)15 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)13 SoapFault11 (com.arjuna.webservices11.SoapFault11)12 NotificationType (com.arjuna.schemas.ws._2005._10.wsarjtx.NotificationType)10 CoordinatorCompletionCoordinatorInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionCoordinatorInboundEvents)10 CoordinatorCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.CoordinatorCompletionParticipantInboundEvents)10 ParticipantCompletionCoordinatorInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents)10 ParticipantCompletionParticipantInboundEvents (com.arjuna.webservices11.wsba.ParticipantCompletionParticipantInboundEvents)9 State (com.arjuna.webservices11.wsba.State)9 ProtocolException (javax.xml.ws.ProtocolException)9 SystemException (com.arjuna.wst.SystemException)8 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)8