Package com.arjuna.ats.arjuna.coordinator

Examples of com.arjuna.ats.arjuna.coordinator.BasicAction


   {
      int action_status = ActionStatus.INVALID;

      try
      {
         BasicAction basic_action = null;

   synchronized ( ActionManager.manager() )
         {
            basic_action = (BasicAction)ActionManager.manager().get( tranUid );
         }

         if ( basic_action != null)
         {
            action_status = basic_action.status();
         }
         else
         {
            /**
             * Run through the object store and try and find the matching id.
View Full Code Here


/*      */
/*  342 */     int conflict = 0;
/*  343 */     int returnStatus = 1;
/*  344 */     LockRecord newLockR = null;
/*  345 */     boolean modifyRequired = false;
/*  346 */     BasicAction currAct = null;
/*      */
/*  348 */     if (toSet == null)
/*      */     {
/*  350 */       if (txojLogger.aitLoggerI18N.isWarnEnabled())
/*      */       {
/*  352 */         txojLogger.aitLoggerI18N.warn("com.arjuna.ats.txoj.LockManager_2");
/*      */       }
/*      */
/*  355 */       return 1;
/*      */     }
/*      */
/*  358 */     currAct = BasicAction.Current();
/*      */
/*  360 */     if (currAct != null)
/*      */     {
/*  362 */       ActionHierarchy ah = currAct.getHierarchy();
/*      */
/*  364 */       if (ah != null) {
/*  365 */         toSet.changeHierarchy(ah);
/*      */       }
/*      */       else {
/*  368 */         if (txojLogger.aitLoggerI18N.isWarnEnabled())
/*      */         {
/*  370 */           txojLogger.aitLoggerI18N.warn("com.arjuna.ats.txoj.LockManager_3");
/*      */         }
/*      */
/*  373 */         toSet = null;
/*      */
/*  375 */         return 1;
/*      */       }
/*      */     }
/*      */
/*  379 */     if (super.loadObjectState()) {
/*  380 */       super.setupStore();
/*      */     }
/*  382 */     while ((conflict == 0) && ((retry >= 0) || (retry == -100)))
/*      */     {
/*  384 */       synchronized (this.locksHeld)
/*      */       {
/*  386 */         conflict = 0;
/*      */
/*  388 */         if (loadState())
/*      */         {
/*  390 */           conflict = lockConflict(toSet);
/*      */         }
/*  394 */         else if (txojLogger.aitLoggerI18N.isWarnEnabled())
/*      */         {
/*  396 */           txojLogger.aitLoggerI18N.warn("com.arjuna.ats.txoj.LockManager_4");
/*      */         }
/*      */
/*  400 */         if (conflict != 0)
/*      */         {
/*  409 */           modifyRequired = toSet.modifiesObject();
/*      */
/*  413 */           if (super.activate())
/*      */           {
/*  415 */             returnStatus = 0;
/*      */
/*  417 */             if (conflict == 1)
/*      */             {
/*  419 */               int lrStatus = 2;
/*      */
/*  421 */               if (currAct != null)
/*      */               {
/*  425 */                 newLockR = new LockRecord(this, !modifyRequired, currAct);
/*      */
/*  427 */                 if ((lrStatus = currAct.add(newLockR)) != 2)
/*      */                 {
/*  429 */                   newLockR = null;
/*      */
/*  431 */                   if (lrStatus == 3) {
/*  432 */                     returnStatus = 1;
View Full Code Here

/*      */         {
/*  730 */           Enumeration e = this.usingActions.keys();
/*      */
/*  732 */           while (e.hasMoreElements())
/*      */           {
/*  734 */             BasicAction action = (BasicAction)e.nextElement();
/*      */
/*  736 */             while (action != null)
/*      */             {
/*  752 */               AbstractRecord A = new CadaverLockRecord(this.lockStore, this, action);
/*      */
/*  754 */               if (action.add(A) != 2) {
/*  755 */                 A = null;
/*      */               }
/*      */             }
/*      */           }
/*      */         }
View Full Code Here

/* 1023 */     if (txojLogger.aitLogger.isDebugEnabled())
/*      */     {
/* 1025 */       txojLogger.aitLogger.debug(16L, 1L, 2L, "LockManager::isAncestorOf(" + heldLock.getCurrentOwner() + ")");
/*      */     }
/*      */
/* 1030 */     BasicAction action = BasicAction.Current();
/*      */
/* 1032 */     if (action == null) {
/* 1033 */       return false;
/*      */     }
/* 1035 */     return action.isAncestor(heldLock.getCurrentOwner());
/*      */   }
View Full Code Here

/* 327 */     return false;
/*     */   }
/*     */
/*     */   public static final AtomicAction suspend()
/*     */   {
/* 346 */     BasicAction curr = ThreadActionData.currentAction();
/*     */
/* 348 */     if (curr != null)
/*     */     {
/* 350 */       if ((curr instanceof AtomicAction)) {
/* 351 */         ThreadActionData.purgeActions();
/*     */       }
/*     */       else {
/* 354 */         if (tsLogger.arjLoggerI18N.isWarnEnabled())
/*     */         {
/* 356 */           tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.atomicaction_1", new Object[] { curr.toString() });
/*     */         }
/*     */
/* 360 */         curr = null;
/*     */       }
/*     */     }
View Full Code Here

/*  95 */     this.currentStatus = 0;
/*  96 */     this.nextLock = null;
/*  97 */     this.lMode = lm;
/*  98 */     this.owners = new ActionHierarchy(0);
/*     */
/* 100 */     BasicAction curr = BasicAction.Current();
/*     */
/* 102 */     if (curr == null)
/*     */     {
/* 104 */       int currentPid = 0;
/* 105 */       ActionHierarchy ah = new ActionHierarchy(1);
/*     */
/* 107 */       if (applicUid == null)
/*     */       {
/* 109 */         applicUid = new Uid();
/*     */       }
/*     */
/* 112 */       if (applicPid != currentPid)
/*     */       {
/* 114 */         Uid temp = new Uid();
/*     */
/* 121 */         applicPid = currentPid;
/* 122 */         applicUid.copy(temp);
/*     */       }
/*     */
/* 125 */       ah.add(applicUid);
/* 126 */       this.owners.copy(ah);
/*     */     }
/*     */     else
/*     */     {
/* 130 */       this.owners.copy(curr.getHierarchy());
/*     */     }
/*     */   }
View Full Code Here

/*     */   private int getActionStatus(Uid tranUid, String transactionType)
/*     */   {
/* 188 */     int action_status = 9;
/*     */     try
/*     */     {
/* 193 */       BasicAction basic_action = null;
/*     */
/* 195 */       synchronized (ActionManager.manager())
/*     */       {
/* 197 */         basic_action = ActionManager.manager().get(tranUid);
/*     */       }
/*     */
/* 200 */       if (basic_action != null)
/*     */       {
/* 202 */         action_status = basic_action.status();
/*     */       }
/*     */       else
/*     */       {
/* 210 */         action_status = getObjectStoreStatus(tranUid, transactionType);
/*     */       }
View Full Code Here

/*     */   private int getTranStatus(Uid tranUid)
/*     */   {
/* 232 */     int action_status = 9;
/*     */     try
/*     */     {
/* 236 */       BasicAction basic_action = null;
/*     */
/* 238 */       synchronized (ActionManager.manager())
/*     */       {
/* 240 */         basic_action = ActionManager.manager().get(tranUid);
/*     */       }
/*     */
/* 243 */       if (basic_action != null)
/*     */       {
/* 245 */         action_status = basic_action.status();
/*     */       }
/*     */       else
/*     */       {
/* 252 */         action_status = getOsStatus(tranUid);
/*     */       }
View Full Code Here

/*     */     throws IllegalArgumentException
/*     */   {
/*  73 */     String threadId = ThreadUtil.getThreadId(thread);
/*  74 */     if (actions.get(threadId) == null)
/*     */     {
/*  76 */       BasicAction currentAction = BasicAction.Current();
/*     */
/*  78 */       if (currentAction != null)
/*     */       {
/*  80 */         currentAction.addChildThread(thread);
/*  81 */         actions.put(threadId, currentAction);
/*     */
/*  83 */         currentAction = null;
/*     */       }
/*     */     }
View Full Code Here

/*     */     }
/*     */   }
/*     */
/*     */   public static void destroy(Thread thread) throws IllegalArgumentException {
/*  92 */     String threadId = ThreadUtil.getThreadId(thread);
/*  93 */     BasicAction currentAction = (BasicAction)actions.remove(threadId);
/*     */
/*  95 */     if (currentAction != null)
/*     */     {
/*  97 */       if (currentAction != null)
/*     */       {
/*  99 */         currentAction.removeChildThread(threadId);
/* 100 */         currentAction = null;
/*     */       }
/*     */     }
/*     */     else
/* 104 */       throw new IllegalArgumentException();
View Full Code Here

TOP

Related Classes of com.arjuna.ats.arjuna.coordinator.BasicAction

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.