Package com.arjuna.wsc

Examples of com.arjuna.wsc.InvalidStateException


        if (protocolIdentifier.equals(TestUtil.ALREADY_REGISTERED_PROTOCOL_IDENTIFIER))
            throw new AlreadyRegisteredException();
        else if (protocolIdentifier.equals(TestUtil.INVALID_PROTOCOL_PROTOCOL_IDENTIFIER))
            throw new InvalidProtocolException();
        else if (protocolIdentifier.equals(TestUtil.INVALID_STATE_PROTOCOL_IDENTIFIER))
            throw new InvalidStateException();
        else if (protocolIdentifier.equals(TestUtil.NO_ACTIVITY_PROTOCOL_IDENTIFIER))
            throw new NoActivityException();

        return new EndpointReferenceType(new AttributedURIType(TestUtil.PROTOCOL_COORDINATOR_SERVICE)) ;
    }
View Full Code Here


        if (protocolIdentifier.equals(TestUtil.ALREADY_REGISTERED_PROTOCOL_IDENTIFIER))
            throw new AlreadyRegisteredException();
        else if (protocolIdentifier.equals(TestUtil.INVALID_PROTOCOL_PROTOCOL_IDENTIFIER))
            throw new InvalidProtocolException();
        else if (protocolIdentifier.equals(TestUtil.INVALID_STATE_PROTOCOL_IDENTIFIER))
            throw new InvalidStateException();
        else if (protocolIdentifier.equals(TestUtil.NO_ACTIVITY_PROTOCOL_IDENTIFIER))
            throw new NoActivityException();

        return TestUtil11.getProtocolCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    }
View Full Code Here

           
                return _coordinatorAddress ;
          }
          catch (RollbackException ex)
          {
             throw new InvalidStateException();
          }
          catch (IllegalStateException ex)
          {
            throw new InvalidStateException();
          }
          catch (javax.transaction.SystemException ex)
          {
            throw new InvalidStateException();
          }
      }
      else
      {
          if (protocolIdentifier.equals(_synchProtocolId))
          {
            try
            {
                _coordManager.getTransaction().registerSynchronization(new JTASynchronization(participantProtocolService));
       
                _coordManager.suspend();
       
                    return _coordinatorAddress ;
            }
            catch (Exception ex)
            {
                throw new InvalidStateException();
            }
          }
          else
          {
            wscfLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wsc.model.jta.RegistrarImple_1",
View Full Code Here

        return _coordinatorAddress;
      }
      catch (Exception ex)
      {
        throw new InvalidStateException();
      }
    }
    else
    {
      if (protocolIdentifier.equals(_synchProtocolId))
      {
        try
        {
          _coordManager.enlistSynchronization(new TwoPhaseSynchronization(
              participantProtocolService));

          _coordManager.suspend();

          return _coordinatorAddress;
        }
        catch (Exception ex)
        {
          throw new InvalidStateException();
        }
      }
      else
      {
        wscfLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wsc.model.twophase.RegistrarImple_1", new Object[]
View Full Code Here

            BusinessActivityConstants.SERVICE_PARTICIPANT_COMPLETION_COORDINATOR,
            id);
      }
      catch (Exception ex)
      {
        throw new InvalidStateException();
      }
    }
    else
      if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION
          .equals(protocolIdentifier))
      {
        final String id = new Uid().stringForm();
        try
        {
                    final CoordinatorCompletionCoordinatorEngine engine = new CoordinatorCompletionCoordinatorEngine(id, participantProtocolService) ;
          BusinessAgreementWithCoordinatorCompletionImple participant = new BusinessAgreementWithCoordinatorCompletionImple(
              new BusinessAgreementWithCoordinatorCompletionStub(engine), id);
                    engine.setCoordinator(participant.participantManager()) ;

          _coordManager.enlistParticipant(participant);

          _coordManager.suspend();

          return getParticipantManager(
              BusinessActivityConstants.SERVICE_COORDINATOR_COMPLETION_COORDINATOR,
              id);
        }
        catch (Exception ex)
        {
          throw new InvalidStateException();
        }
      }
      else
        if (ArjunaTXConstants.WSARJTX_PROTOCOL_TERMINATION.equals(protocolIdentifier))
        {
          try
          {
            return getParticipantManager(
                ArjunaTXConstants.SERVICE_TERMINATION_COORDINATOR,
                instanceIdentifier.getInstanceIdentifier());
          }
          catch (Exception ex)
          {
            throw new InvalidStateException();
          }
        }
        else
        {
          wstxLogger.arjLoggerI18N
View Full Code Here

        return getCoordinator(participantId) ;
      }
      catch (Exception ex)
      {
        throw new InvalidStateException();
      }
    }
    else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
    {
      // 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) ;
      }
      catch (Exception ex)
      {
        throw new InvalidStateException();
      }
    }
    else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
    {
      try
      {
                final CompletionCoordinatorParticipant participant = new CompletionCoordinatorImple(_coordManager, hier, true) ;
                CompletionCoordinatorProcessor.getProcessor().activateParticipant(participant, instanceIdentifier.getInstanceIdentifier()) ;

        _coordManager.suspend();

        return getCompletionCoordinator(instanceIdentifier) ;
      }
      catch (Exception ex)
      {
        ex.printStackTrace();

        throw new InvalidStateException(ex.toString());
      }
    }
    else
    {
      wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
View Full Code Here

                return getCoordinator(participantId) ;
            }
            catch (Exception ex)
            {
                throw new InvalidStateException();
            }
    }
    else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC.equals(protocolIdentifier))
    {
      // 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) ;
            }
            catch (Exception ex)
            {
                throw new InvalidStateException();
            }
    }
    else if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_COMPLETION.equals(protocolIdentifier))
    {
      // not allowed for subordinate transactions!
     
      throw new InvalidStateException();
    }
    else
    {
      wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
      { AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });
View Full Code Here

            (Durable2PCParticipant) participant,
            new Uid().toString()));
      }
      catch (Exception ex)
      {
        throw new InvalidStateException();
      }
    }
    else
    {
      if (protocolIdentifier.equals(AtomicTransactionConstants.WSAT_SUB_PROTOCOL_VOLATILE_2PC))
      {
        try
        {
          _coordManager.enlistSynchronization(new VolatileTwoPhaseCommitParticipant(
              (Volatile2PCParticipant) participant));
        }
        catch (Exception ex)
        {
          throw new InvalidStateException();
        }
      }
      else
      {
        wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.local.LocalRegistrarImple_1", new Object[]
View Full Code Here

        LocalParticipantCompletionParticipantStub recoverableParticipant = new LocalParticipantCompletionParticipantStub((BusinessAgreementWithParticipantCompletionParticipant)participant, participantId);
        _coordManager.enlistParticipant(new com.arjuna.mwlabs.wst.ba.participants.BusinessAgreementWithParticipantCompletionImple(recoverableParticipant, participantId));
      }
      catch (Exception ex)
      {
    throw new InvalidStateException();
      }
  }
  else
  {
      if (protocolIdentifier.equals(BusinessActivityConstants.WSBA_SUB_PROTOCOL_COORDINATOR_COMPLETION))
      {
    try
    {
            LocalCoordinatorCompletionParticipantStub recoverableParticipant = new LocalCoordinatorCompletionParticipantStub((BusinessAgreementWithCoordinatorCompletionParticipant)participant, participantId);
        _coordManager.enlistParticipant(new com.arjuna.mwlabs.wst.ba.participants.BusinessAgreementWithCoordinatorCompletionImple(recoverableParticipant, participantId));
    }
    catch (Exception ex)
    {
        throw new InvalidStateException();
    }
      }
      else
      {
    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.ba.local.LocalRegistrarImple_1",
View Full Code Here

           
                return _coordinatorAddress ;
          }
          catch (RollbackException ex)
          {
             throw new InvalidStateException();
          }
          catch (IllegalStateException ex)
          {
            throw new InvalidStateException();
          }
          catch (javax.transaction.SystemException ex)
          {
            throw new InvalidStateException();
          }
      }
      else
      {
          if (protocolIdentifier.equals(_synchProtocolId))
          {
            try
            {
                _coordManager.getTransaction().registerSynchronization(new JTASynchronization(participantProtocolService));
       
                _coordManager.suspend();
       
                    return _coordinatorAddress ;
            }
            catch (Exception ex)
            {
                throw new InvalidStateException();
            }
          }
          else
          {
            wscfLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wsc.model.jta.RegistrarImple_1",
View Full Code Here

TOP

Related Classes of com.arjuna.wsc.InvalidStateException

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.