Package com.arjuna.ArjunaOTS

Examples of com.arjuna.ArjunaOTS.InterpositionFailed


      {
        jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.excalledagain", new Object[]
        { "ExplicitInterposition.unregisterTransaction" });
      }

      throw new InterpositionFailed();
    }

    boolean registerNull = false;

    if (action != null)
    {
      try
      {
        Coordinator coord = action.get_coordinator();

        if (coord != null)
        {
          PropagationContext ctx = coord.get_txcontext();

          if (ctx != null)
          {
            try
            {
              registerTransaction(ctx);
              ctx = null;
            }
            catch (Exception e)
            {
              e.printStackTrace();

              ctx = null;

              throw new InterpositionFailed(e.toString());
            }
          }
          else
            registerNull = true;

          coord = null;
        }
        else
          registerNull = true;
      }
      catch (Exception e)
      {
        e.printStackTrace();

        throw new InterpositionFailed(e.toString());
      }
    }
    else
    {
      _inUse = true;
      registerNull = true;
    }

    if (registerNull)
    {
      try
      {
        OTSImpleManager.current().resume((Control) null);
      }
      catch (Exception e)
      {
        e.printStackTrace();

        throw new InterpositionFailed(e.toString());
      }
    }
  }
View Full Code Here


      {
        jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.excalledagain", new Object[]
        { "ExplicitInterposition.registerTransaction" });
      }

      throw new InterpositionFailed();
    }

    if ((ctx == null) || (ctx.current.coord == null)) // invalid
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION,
          CompletionStatus.COMPLETED_NO);

    _inUse = true;

    TransactionFactoryImple _localFactory = OTSImpleManager.factory();

    try
    {
      ControlImple cont = _localFactory.recreateLocal(ctx);
      CurrentImple current = OTSImpleManager.current();

      /*
       * If this thread is associated with any transactions, then they
       * will be lost in favour of this new hierarchy, unless we have
       * remembered them explicitly.
       */

      if (_remember)
      {
        try
        {
          _oldControl = current.suspendWrapper();
        }
        catch (Exception e)
        {
          throw new InterpositionFailed();
        }
      }

      current.resumeImple(cont);

      //      current.resume(cont.getControl());

      cont = null;
    }
    catch (InterpositionFailed ex)
    {
      throw ex;
    }
    catch (Exception e)
    {
      if (jtsLogger.loggerI18N.isWarnEnabled())
      {
        jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.eicaughtexception", new Object[]
        { "ExplicitInterposition.registerTransaction(PropagationContext)", e });
      }

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

      {
        jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.excalledagain", new Object[]
        { "ExplicitInterposition.unregisterTransaction" });
      }

      throw new InterpositionFailed();
    }

    boolean registerNull = false;

    if (action != null)
    {
      try
      {
        Coordinator coord = action.get_coordinator();

        if (coord != null)
        {
          PropagationContext ctx = coord.get_txcontext();

          if (ctx != null)
          {
            try
            {
              registerTransaction(ctx);
              ctx = null;
            }
            catch (Exception e)
            {
              e.printStackTrace();

              ctx = null;

              throw new InterpositionFailed(e.toString());
            }
          }
          else
            registerNull = true;

          coord = null;
        }
        else
          registerNull = true;
      }
      catch (Exception e)
      {
        e.printStackTrace();

        throw new InterpositionFailed(e.toString());
      }
    }
    else
    {
      _inUse = true;
      registerNull = true;
    }

    if (registerNull)
    {
      try
      {
        OTSImpleManager.current().resume((Control) null);
      }
      catch (Exception e)
      {
        e.printStackTrace();

        throw new InterpositionFailed(e.toString());
      }
    }
  }
View Full Code Here

      {
        jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.excalledagain", new Object[]
        { "ExplicitInterposition.registerTransaction" });
      }

      throw new InterpositionFailed();
    }

    if ((ctx == null) || (ctx.current.coord == null)) // invalid
      throw new INVALID_TRANSACTION(ExceptionCodes.INVALID_ACTION,
          CompletionStatus.COMPLETED_NO);

    _inUse = true;

    TransactionFactoryImple _localFactory = OTSImpleManager.factory();

    try
    {
      ControlImple cont = _localFactory.recreateLocal(ctx);
      CurrentImple current = OTSImpleManager.current();

      /*
       * If this thread is associated with any transactions, then they
       * will be lost in favour of this new hierarchy, unless we have
       * remembered them explicitly.
       */

      if (_remember)
      {
        try
        {
          _oldControl = current.suspendWrapper();
        }
        catch (Exception e)
        {
          throw new InterpositionFailed();
        }
      }

      current.resumeImple(cont);

      //      current.resume(cont.getControl());

      cont = null;
    }
    catch (InterpositionFailed ex)
    {
      throw ex;
    }
    catch (Exception e)
    {
      if (jtsLogger.loggerI18N.isWarnEnabled())
      {
        jtsLogger.loggerI18N.warn("com.arjuna.ats.jts.eicaughtexception", new Object[]
        { "ExplicitInterposition.registerTransaction(PropagationContext)", e });
      }

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

TOP

Related Classes of com.arjuna.ArjunaOTS.InterpositionFailed

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.