Package com.arjuna.mw.wst

Examples of com.arjuna.mw.wst.TransactionManager


  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_COMMIT, FailureParticipant.WRONG_STATE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
     
      ut.commit();

      passed = false;
  }
View Full Code Here


    {
  boolean passed = false;
 
  try
  {
      TransactionManager ut = TransactionManager.getTransactionManager();
 
      TxContext ctx = ut.suspend();

      System.out.println("Suspended: "+ctx);

      if (ctx == null)
    passed = true;
View Full Code Here

  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
 
      ut.begin();
     
      TxContext ctx = tm.suspend();

      System.out.println("Suspended: "+ctx);
     
      passed = true;
  }
View Full Code Here

  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.WRONG_STATE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
     
      ut.commit();

      passed = false;
  }
View Full Code Here

  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_ROLLBACK, FailureParticipant.WRONG_STATE);
      DemoDurableParticipant p2 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
     
      ut.rollback();

      passed = true;
  }
View Full Code Here

  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p1 = new DemoDurableParticipant();
      DemoDurableParticipant p2 = new DemoDurableParticipant();
      DemoDurableParticipant p3 = new DemoDurableParticipant();
      DemoDurableParticipant p4 = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p1, null);
      tm.enlistForDurableTwoPhase(p2, null);
      tm.enlistForDurableTwoPhase(p3, null);
      tm.enlistForDurableTwoPhase(p4, null);
     
      ut.commit();

      passed = p1.passed() && p2.passed() && p3.passed() && p4.passed();
  }
View Full Code Here

    {
        if (soapMessage != null)
        {
            try
            {
                final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
                final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;

                if (transactionManager != null)
                {
                    final com.arjuna.mwlabs.wst.at.context.TxContextImple txContext =
                        (com.arjuna.mwlabs.wst.at.context.TxContextImple)transactionManager.suspend() ;

                    if (txContext != null)
                    {
                        messageContext.setProperty(AtomicTransactionConstants.WSAT_PROTOCOL, txContext) ;
                    }
                }

                if (businessActivityManager != null)
                {
                    final com.arjuna.mwlabs.wst.ba.context.TxContextImple txContext =
                        (com.arjuna.mwlabs.wst.ba.context.TxContextImple)businessActivityManager.suspend() ;

                    if (txContext != null)
                    {
                        messageContext.setProperty(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME, txContext) ;
                    }
                }

                final Element soapHeaderElement = soapMessage.getHeaderElement(CoordinationConstants.WSCOOR_NAMESPACE, CoordinationConstants.WSCOOR_ELEMENT_COORDINATION_CONTEXT) ;

                if (soapHeaderElement != null)
                {
                    final CoordinationContextType cc = CoordinationContextHelper.deserialise(soapHeaderElement) ;

                    final String coordinationType = cc.getCoordinationType().getValue() ;

                    if (AtomicTransactionConstants.WSAT_PROTOCOL.equals(coordinationType))
                    {
                        final TxContext txContext = new com.arjuna.mwlabs.wst.at.context.TxContextImple(cc) ;
                        transactionManager.resume(txContext) ;
                    }
                    else if (BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME.equals(coordinationType))
                    {
                        final TxContext txContext = new com.arjuna.mwlabs.wst.ba.context.TxContextImple(cc);
                        businessActivityManager.resume(txContext) ;
View Full Code Here

        {
            /*
             * There should either be an Atomic Transaction *or* a Business Activity
             * associated with the thread.
             */
            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;

            if (transactionManager != null)
            {
                transactionManager.suspend() ;
            }

            if (businessActivityManager != null)
            {
                businessActivityManager.suspend() ;
View Full Code Here

    public void intercept( electric.soap.SOAPMessage soapMessage, electric.util.Context messageContext )
    {
        try
        {
            final TransactionManager transactionManager = TransactionManagerFactory.transactionManager() ;
            final com.arjuna.mwlabs.wst.at.context.TxContextImple atTXContext =
                (com.arjuna.mwlabs.wst.at.context.TxContextImple)messageContext.getProperty(AtomicTransactionConstants.WSAT_PROTOCOL) ;

            if (atTXContext != null)
            {
                transactionManager.resume(atTXContext) ;
            }
            else
            {
                transactionManager.suspend() ;
            }

            final BusinessActivityManager businessActivityManager = BusinessActivityManagerFactory.businessActivityManager() ;
            final com.arjuna.mwlabs.wst.ba.context.TxContextImple baTXContext =
                (com.arjuna.mwlabs.wst.ba.context.TxContextImple)messageContext.getProperty(BusinessActivityConstants.WSBA_PROTOCOL_ATOMIC_OUTCOME) ;
View Full Code Here

  boolean passed = false;
 
  try
  {
      UserTransaction ut = UserTransaction.getUserTransaction();
      TransactionManager tm = TransactionManager.getTransactionManager();
      DemoDurableParticipant p = new DemoDurableParticipant();
     
      ut.begin();
     
      tm.enlistForDurableTwoPhase(p, null);

      TxContext ctx = tm.suspend();
     
      System.out.println("Suspended: "+ctx);

      tm.resume(ctx);

      System.out.println("\nResumed\n");

      ut.commit();
View Full Code Here

TOP

Related Classes of com.arjuna.mw.wst.TransactionManager

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.