Package com.arjuna.wst11.tests.junit.ba

Examples of com.arjuna.wst11.tests.junit.ba.Compensate


      final W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);

      if (completionCoordinator == null)
        throw new WrongStateException();

      CompletionStub completionStub = new CompletionStub(id, completionCoordinator);

      completionStub.commit();
    }
    catch (SystemException ex)
    {
      throw ex;
    }
View Full Code Here


      W3CEndpointReference completionCoordinator = (W3CEndpointReference) _completionCoordinators.get(id);

      if (completionCoordinator == null)
        throw new WrongStateException();

      CompletionStub completionStub = new CompletionStub(id, completionCoordinator);

      completionStub.rollback();
    }
    catch (SystemException ex)
    {
      throw ex;
    }
View Full Code Here

     */
    public static CompletionCoordinatorParticipant registerCompletion(final CoordinationContextType context, final String id)
        throws Exception
    {
        final W3CEndpointReference completionCoordinator = register(context, getCompletionParticipant(id), AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION) ;
        return new CompletionStub(id, completionCoordinator);
    }
View Full Code Here

      // enlist participant that wraps the requester URI.
      final String participantId = "D" + new Uid().stringForm();

      try
      {
                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
        _coordManager.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));

        _coordManager.suspend();

        return getCoordinator(participantId, isSecure) ;
View Full Code Here

      // enlist participant that wraps the requester URI.
            final String participantId = "D" + new Uid().stringForm();

            try
            {
                final Durable2PCStub participantStub = new Durable2PCStub(participantId, participantProtocolService) ;
                theTx.enlistParticipant(new DurableTwoPhaseCommitParticipant(participantStub, participantId));

                return getCoordinator(participantId, isSecure) ;
            }
            catch (Exception ex)
View Full Code Here

                    // hmm, need to create wrappers here as the subTx is in WSCF which only knows
                    // about WSAS and WS-C and the participant is in WS-T
                    String vtppid = subTx.getVolatile2PhaseId();
                    String dtppid = subTx.getDurable2PhaseId();
                    Volatile2PCParticipant vtpp = new SubordinateVolatile2PCStub(subTx);
                    Durable2PCParticipant dtpp = new SubordinateDurable2PCStub(subTx);
                    final String messageId = MessageId.getMessageId() ;
                    W3CEndpointReference participant;
                    W3CEndpointReference coordinator;
                    participant= getParticipant(vtppid, isSecure);
                    coordinator = RegistrationCoordinator.register(currentContext, messageId, participant, AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC) ;
View Full Code Here

                    SubordinateCoordinator subTx = (SubordinateCoordinator) createSubordinate();
                    // hmm, need to create wrappers here as the subTx is in WSCF which only knows
                    // about WSAS and WS-C and the participant is in WS-T
                    String vtppid = subTx.getVolatile2PhaseId();
                    String dtppid = subTx.getDurable2PhaseId();
                    Volatile2PCParticipant vtpp = new SubordinateVolatile2PCStub(subTx);
                    Durable2PCParticipant dtpp = new SubordinateDurable2PCStub(subTx);
                    final String messageId = MessageId.getMessageId() ;
                    W3CEndpointReference participant;
                    W3CEndpointReference coordinator;
                    participant= getParticipant(vtppid, isSecure);
View Full Code Here

      // enlist participant that wraps the requester URI.
      final String participantId = "V" + new Uid().stringForm();

      try
      {
                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
        _coordManager.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;

        _coordManager.suspend();

        return getCoordinator(participantId, isSecure) ;
View Full Code Here

      // enlist participant that wraps the requester URI.
            final String participantId = "V" + new Uid().stringForm();

            try
            {
                final Volatile2PCStub participantStub = new Volatile2PCStub(participantId, participantProtocolService) ;
                theTx.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(participantStub)) ;

                return getCoordinator(participantId, isSecure) ;
            }
            catch (Exception ex)
View Full Code Here

        final String messageId = "123456" ;
        final String instanceIdentifier = "testSendCommitted" ;
        final W3CEndpointReference completionInitiatorEndpoint = TestUtil.getCompletionInitiatorEndpoint(instanceIdentifier);
        final AddressingProperties addressingProperties = AddressingHelper.createRequestContext(TestUtil.completionInitiatorServiceURI, messageId) ;

        final TestCompletionInitiatorCallback callback = new TestCompletionInitiatorCallback() {
            public void committed(final Notification committed, final AddressingProperties addressingProperties, final ArjunaContext arjunaContext)
            {
                assertEquals(addressingProperties.getTo().getURI().toString(), TestUtil.completionInitiatorServiceURI);
                assertNull(addressingProperties.getFrom());
                assertNotNull(addressingProperties.getFaultTo());
                assertEquals(addressingProperties.getFaultTo().getAddress().getURI().toString(), TestUtil.completionCoordinatorServiceURI);
                assertNotNull(addressingProperties.getReplyTo());
                assertTrue(AddressingHelper.isNoneReplyTo(addressingProperties));
                assertEquals(addressingProperties.getMessageID().getURI().toString(), messageId);

                assertNotNull(arjunaContext) ;
                assertEquals(instanceIdentifier, arjunaContext.getInstanceIdentifier().getInstanceIdentifier()) ;
            }
        };
        final CompletionInitiatorProcessor initiator = CompletionInitiatorProcessor.getProcessor() ;
        initiator.registerCallback(instanceIdentifier, callback) ;

        try
        {
            CompletionInitiatorClient.getClient().sendCommitted(completionInitiatorEndpoint, addressingProperties, new InstanceIdentifier("sender")) ;
            callback.waitUntilTriggered() ;
        }
        finally
        {
            initiator.removeCallback(instanceIdentifier) ;
        }

        assertTrue(callback.hasTriggered()) ;
        assertFalse(callback.hasFailed()) ;
    }
View Full Code Here

TOP

Related Classes of com.arjuna.wst11.tests.junit.ba.Compensate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.