Package com.arjuna.ats.internal.jts

Examples of com.arjuna.ats.internal.jts.ControlWrapper


     */

    public ControlWrapper current (String threadId) throws SystemException
    {
  Object arg = otsCurrent.get(threadId);
  ControlWrapper wrapper = null;

  if (arg != null)
  {
      try
      {
View Full Code Here


      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
             com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ContextManager::current ()");
  }

  Object arg = otsCurrent.get(ThreadUtil.getThreadId());
  ControlWrapper wrapper = null;

  if (arg != null)
  {
      try
      {
View Full Code Here

  {
      jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
             com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ContextManager::popAction ()");
  }

  ControlWrapper action = null;
  Object arg = otsCurrent.get(threadId);

  if (arg != null)
  {
      Stack sl = (Stack) arg;

      try
      {
    /*
     * When we pushed the action we did the check for whether
     * it was local to save time now.
     */

    action = (ControlWrapper) sl.pop();
      }
      catch (EmptyStackException e)
      {
      }

      /*
       * If size now zero we can delete from thread
       * specific data.
       */

      if (sl.size() == 0)
      {
    sl = null;

    otsCurrent.remove(threadId);

    disassociateContext();
      }
  }

  /*
   * Now update action in thread's notion of current if
   * this action is local.
   */

  // Check that action is local and not a proxy.

  if (action != null)
  {
      /*
       * Now update action in thread's notion of current if
       * this action is local.
       */

      // Check that action is local and not a proxy.

      if (action.isLocal())
      {
    /*
     * If transaction is terminated by another thread
     * then our thread-action information may have already
     * been removed from the action.
View Full Code Here

   * not commit/abort them. Just because this thread is
   * finished with them does not mean other threads
   * are!
   */

  ControlWrapper ptr = popAction(threadId);

  while (ptr != null)
  {
      ptr = null;

View Full Code Here

   * Here until we can make this work with recreate.
   */

  if (false)
  {
      pushAction(new ControlWrapper(cont));

      return true;
  }
  else
  {
      boolean isError = false;

      try
      {
    Coordinator coord = cont.get_coordinator();
    PropagationContext ctx = coord.get_txcontext();

    if (ctx != null)
    {
        /*
         * Depth must be non-zero or we wouldn't be here!
         */

        int depth = ctx.parents.length;

        for (int i = depth -1; i >= 0; i--)
        {
      /*
       * No memory leak as we delete either when suspend
       * is called, or the transaction is terminated.
       */

      Coordinator tmpCoord = ctx.parents[i].coord;
      Terminator tmpTerm = ctx.parents[i].term;

      Control theControl = TransactionFactoryImple.createProxy(tmpCoord, tmpTerm);

      pushAction(new ControlWrapper(theControl))// takes care of thread/BasicAction for us.
        }

        ctx = null;
    }
    else
View Full Code Here

      Control parentControl = actControl.getParentControl();
      Stack hier = new Stack();

      while (parentControl != null)
      {
    hier.push(new ControlWrapper(parentControl));

    actControl = com.arjuna.ArjunaOTS.ActionControlHelper.narrow(parentControl);

    /*
     * Currently assume that entire hierarchy will contain only one
     * type of action, i.e., Arjuna actions or someone elses!
     */

    if (actControl != null)
        parentControl = actControl.getParentControl();
    else
        parentControl = null;
      }

      actControl = null;

      try
      {
    ControlWrapper wrapper = (ControlWrapper) hier.pop();

    while (wrapper != null)
    {
        pushAction(wrapper);

View Full Code Here

      ControlImple curr = which.getParentImple();
      Stack hier = new Stack();

      while (curr != null)
      {
    hier.push(new ControlWrapper(curr));

    curr = curr.getParentImple();
      }

      try
      {
    ControlWrapper wrapper = (ControlWrapper) hier.pop();

    while (wrapper != null)
    {
        pushAction(wrapper);
View Full Code Here

     * interceptor can do the suspend when the call returns.
     */

    if (ctx.type().kind().value() != TCKind._tk_null)
    {
        ControlWrapper control = null;

        // Is this just a Coordinator, or a full blown context?

        if (ctx.type().kind().value() == TCKind._tk_string)
        {
View Full Code Here

    Coordinator theCoordinator = org.omg.CosTransactions.CoordinatorHelper.narrow(obj);

    if (theCoordinator == null)
        throw new BAD_PARAM();

    return new ControlWrapper(TransactionFactoryImple.createProxy(theCoordinator, null));
      }
      else
    return null;
  }
  catch (BAD_PARAM e1)
View Full Code Here

    if (OTSImpleManager.localFactory())
    {
        TransactionFactoryImple theFactory = OTSImpleManager.factory();

        return new ControlWrapper(theFactory.recreateLocal(theContext));
    }
    else
    {
        TransactionFactory theFactory = OTSImpleManager.get_factory();

        return new ControlWrapper(theFactory.recreate(theContext));
    }
      }
      catch (SystemException ex)
      {
    if (jtsLogger.loggerI18N.isWarnEnabled())
View Full Code Here

TOP

Related Classes of com.arjuna.ats.internal.jts.ControlWrapper

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.