Package com.arjuna.wsc

Examples of com.arjuna.wsc.InvalidProtocolException


        throws AlreadyRegisteredException, InvalidProtocolException, InvalidStateException, NoActivityException
    {
        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();
View Full Code Here


        throws AlreadyRegisteredException, InvalidProtocolException, InvalidStateException, NoActivityException
    {
        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();
View Full Code Here

          {
              throw new NoActivityException();
          }
          catch (javax.transaction.SystemException ex)
          {
              throw new InvalidProtocolException();
          }
   
          try
          {
            // TODO check for AlreadyRegisteredException
       
            _coordManager.getTransaction().enlistResource(new JTAParticipant(participantProtocolService));
           
            _coordManager.suspend();
           
                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",
                        new Object[]{_coordinationTypeURI, protocolIdentifier});
       
            throw new InvalidProtocolException();
          }
      }
    }
View Full Code Here

      {
        throw new NoActivityException();
      }
      catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
      {
        throw new InvalidProtocolException();
      }

      try
      {
        // TODO check for AlreadyRegisteredException

        final String participantId = new Uid().stringForm();
        _coordManager.enlistParticipant(new TwoPhaseParticipant(
            participantProtocolService, participantId));

        _coordManager.suspend();

        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[]
        { _coordinationTypeURI, protocolIdentifier });

        throw new InvalidProtocolException();
      }
    }
  }
View Full Code Here

    {
      throw new NoActivityException();
    }
    catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
    {
      throw new InvalidProtocolException();
    }

    // TODO check for AlreadyRegisteredException

    if (BusinessActivityConstants.WSBA_SUB_PROTOCOL_PARTICIPANT_COMPLETION
        .equals(protocolIdentifier))
    {
      // enlist participant that wraps the requester URI.
      final String id = new Uid().stringForm();

      try
      {
                final ParticipantCompletionCoordinatorEngine engine = new ParticipantCompletionCoordinatorEngine(id, participantProtocolService) ;
        BusinessAgreementWithParticipantCompletionImple participant = new BusinessAgreementWithParticipantCompletionImple(
            new BusinessAgreementWithParticipantCompletionStub(engine), id);
                engine.setCoordinator(participant.participantManager()) ;

        _coordManager.enlistParticipant(participant);

        _coordManager.suspend();

        return getParticipantManager(
            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
              .warn(
                  "com.arjuna.mwlabs.wst.ba.RegistrarImple_1",
                  new Object[] { BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier });

          throw new InvalidProtocolException();
        }
  }
View Full Code Here

    {
      throw new NoActivityException();
    }
    catch (com.arjuna.mw.wsas.exceptions.SystemException ex)
    {
      throw new InvalidProtocolException();
    }

    // TODO check for AlreadyRegisteredException

    if (AtomicTransactionConstants.WSAT_SUB_PROTOCOL_DURABLE_2PC.equals(protocolIdentifier))
    {
      // 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) ;
      }
      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[]
      { AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });

      throw new InvalidProtocolException();
    }
  }
View Full Code Here

    else
    {
      wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.RegistrarImple_1", new Object[]
      { AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });

      throw new InvalidProtocolException();
    }
  }
View Full Code Here

      else
      {
        wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.at.local.LocalRegistrarImple_1", new Object[]
        { AtomicTransactionConstants.WSAT_PROTOCOL, protocolIdentifier });

        throw new InvalidProtocolException();
      }
    }
  }
View Full Code Here

      else
      {
    wstxLogger.arjLoggerI18N.warn("com.arjuna.mwlabs.wst.ba.local.LocalRegistrarImple_1",
                new Object[]{BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, protocolIdentifier});

    throw new InvalidProtocolException();
      }
  }
    }
View Full Code Here

          {
              throw new NoActivityException();
          }
          catch (javax.transaction.SystemException ex)
          {
              throw new InvalidProtocolException();
          }
   
          try
          {
            // TODO check for AlreadyRegisteredException
       
            _coordManager.getTransaction().enlistResource(new JTAParticipant(participantProtocolService));
           
            _coordManager.suspend();
           
                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",
                        new Object[]{_coordinationTypeURI, protocolIdentifier});
       
            throw new InvalidProtocolException();
          }
      }
    }
View Full Code Here

TOP

Related Classes of com.arjuna.wsc.InvalidProtocolException

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.