Package com.arjuna.ats.arjuna.coordinator

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


/*      */   {
/*   99 */     if (ot == 1)
/*      */     {
/*      */       try
/*      */       {
/*  103 */         BasicAction action = BasicAction.Current();
/*      */
/*  105 */         if (action == null)
/*  106 */           packHeader(os, null, Utility.getProcessUid());
/*      */         else
/*  108 */           packHeader(os, action.get_uid(), Utility.getProcessUid());
/*      */       }
/*      */       catch (IOException e)
/*      */       {
/*  112 */         return false;
/*      */       }
View Full Code Here


/*  157 */       tsLogger.arjLogger.debug(2L, 4L, 32L, "StateManager.finalize() for object-id " + get_uid());
/*      */     }
/*      */
/*  161 */     if (this.currentStatus == 3)
/*      */     {
/*  163 */       BasicAction action = BasicAction.Current();
/*      */
/*  165 */       if ((action != null) && (action.status() == 0))
/*      */       {
/*  167 */         if (tsLogger.arjLoggerI18N.isWarnEnabled())
/*  168 */           tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.StateManager_1");
/*  169 */         cleanup(false);
/*      */       }
View Full Code Here

/*      */     }
/*      */
/*  242 */     if (this.currentStatus == 4) {
/*  243 */       return false;
/*      */     }
/*  245 */     BasicAction action = null;
/*  246 */     int oldStatus = this.currentStatus;
/*  247 */     boolean result = true;
/*  248 */     boolean forceAR = false;
/*      */
/*  258 */     action = BasicAction.Current();
/*      */
/*  260 */     if ((action != null) && (action.status() == 0))
/*      */     {
/*  274 */       synchronized (this.usingActions)
/*      */       {
/*  276 */         if (this.usingActions.get(action.topLevelAction().get_uid()) == null)
/*      */         {
/*  278 */           this.usingActions.put(action.topLevelAction().get_uid(), action.topLevelAction());
/*  279 */           forceAR = true;
/*      */         }
/*      */       }
/*      */     }
/*      */
/*  284 */     if ((forceAR) || (this.currentStatus == 0) || (this.currentStatus == 1))
/*      */     {
/*  292 */       if (loadObjectState())
/*      */       {
/*  294 */         setupStore(rootName);
/*      */       }
/*      */
/*  299 */       if (this.currentStatus == 0)
/*      */       {
/*  308 */         if (loadObjectState())
/*      */         {
/*  310 */           InputObjectState oldState = null;
/*      */           try
/*      */           {
/*  314 */             oldState = this.objectStore.read_committed(this.objectUid, type());
/*      */           }
/*      */           catch (ObjectStoreException e)
/*      */           {
/*  318 */             oldState = null;
/*      */           }
/*      */
/*  321 */           if (oldState != null)
/*      */           {
/*  323 */             if ((result = restore_state(oldState, 1)))
/*      */             {
/*  325 */               this.currentStatus = 2;
/*      */             }
/*      */
/*  328 */             oldState = null;
/*      */           }
/*      */           else
/*      */           {
/*  332 */             if (tsLogger.arjLoggerI18N.isWarnEnabled())
/*      */             {
/*  334 */               tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.StateManager_2", new Object[] { this.objectUid, type() });
/*      */             }
/*      */
/*  338 */             return false;
/*      */           }
/*      */
/*      */         }
/*  343 */         else if (this.currentStatus == 1) {
/*  344 */           this.currentStatus = 3;
/*      */         } else {
/*  346 */           this.currentStatus = 2;
/*      */         }
/*      */
/*      */       }
/*  351 */       else if (this.currentStatus == 1)
/*  352 */         this.currentStatus = 3;
/*      */       else {
/*  354 */         this.currentStatus = 2;
/*      */       }
/*      */
/*  362 */       if ((forceAR) || (((this.currentStatus == 2) || (this.currentStatus == 1)) && (action != null)))
/*      */       {
/*  365 */         int arStatus = 2;
/*  366 */         ActivationRecord ar = new ActivationRecord(oldStatus, this, action.topLevelAction());
/*      */
/*  368 */         if ((arStatus = action.add(ar)) != 2)
/*      */         {
/*  370 */           ar = null;
/*      */
/*  372 */           if (forceAR)
/*      */           {
/*  374 */             synchronized (this.usingActions)
/*      */             {
/*  376 */               this.usingActions.remove(action.topLevelAction().get_uid());
/*      */             }
/*      */           }
/*      */
/*  380 */           if (arStatus == 3) {
/*  381 */             result = false;
View Full Code Here

/*      */
/*  551 */     boolean result = false;
/*      */
/*  553 */     if (this.objectStore != null)
/*      */     {
/*  555 */       BasicAction action = BasicAction.Current();
/*      */
/*  557 */       if (action != null)
/*      */       {
/*  559 */         DisposeRecord dr = new DisposeRecord(this.objectStore, this);
/*      */
/*  561 */         if (action.add(dr) != 2)
/*      */         {
/*  563 */           dr = null;
/*      */
/*  565 */           if (tsLogger.arjLoggerI18N.isWarnEnabled())
/*      */           {
View Full Code Here

/*  950 */     if (tsLogger.arjLogger.debugAllowed())
/*      */     {
/*  952 */       tsLogger.arjLogger.debug(16L, 2L, 32L, "StateManager::modified() for object-id " + get_uid());
/*      */     }
/*      */
/*  956 */     BasicAction action = BasicAction.Current();
/*  957 */     RecoveryRecord record = null;
/*      */
/*  959 */     if ((this.myType == 2) || (this.currentStatus == 4))
/*      */     {
/*  961 */       return true;
/*      */     }
/*      */
/*  964 */     if (this.currentStatus == 0)
/*      */     {
/*  966 */       if (tsLogger.arjLoggerI18N.isWarnEnabled())
/*  967 */         tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.StateManager_10");
/*  968 */       activate();
/*      */     }
/*      */
/*  975 */     if (this.currentStatus == 1) {
/*  976 */       this.currentStatus = 3;
/*      */     }
/*  978 */     if (action != null)
/*      */     {
/*  986 */       synchronized (this.modifyingActions)
/*      */       {
/*  988 */         if ((this.modifyingActions.size() > 0) && (this.modifyingActions.get(action.get_uid()) != null))
/*      */         {
/*  991 */           return true;
/*      */         }
/*      */
/*  994 */         this.modifyingActions.put(action.get_uid(), action);
/*      */       }
/*      */
/*  999 */       OutputObjectState state = new OutputObjectState(this.objectUid, type());
/* 1000 */       int rStatus = 2;
/*      */
/* 1002 */       if (save_state(state, 0))
/*      */       {
/* 1004 */         if ((this.myType == 0) && (this.smAttributes.objectModel == 0))
/*      */         {
/* 1006 */           record = new RecoveryRecord(state, this);
/*      */         }
/*      */         else {
/* 1009 */           record = new PersistenceRecord(state, this.objectStore, this);
/*      */         }
/* 1011 */         if ((rStatus = action.add(record)) != 2)
/*      */         {
/* 1013 */           synchronized (this.modifyingActions)
/*      */           {
/* 1015 */             this.modifyingActions.remove(action.get_uid());
/*      */           }
/*      */
/* 1018 */           record = null;
/*      */
/* 1020 */           return false;
View Full Code Here

/*      */     }
/*      */
/* 1072 */     if (this.myType == 2) {
/* 1073 */       return;
/*      */     }
/* 1075 */     BasicAction action = null;
/*      */
/* 1077 */     synchronized (this.usingActions)
/*      */     {
/* 1079 */       if (this.usingActions != null)
/*      */       {
/* 1081 */         Enumeration e = this.usingActions.keys();
/*      */
/* 1083 */         while (e.hasMoreElements())
/*      */         {
/* 1085 */           action = (BasicAction)this.usingActions.remove(e.nextElement());
/*      */
/* 1087 */           if (action == null)
/*      */           {
/*      */             continue;
/*      */           }
/*      */
/* 1096 */           AbstractRecord record = null;
/* 1097 */           int rStatus = 2;
/*      */
/* 1099 */           if ((this.currentStatus == 3) || (this.currentStatus == 2))
/*      */           {
/* 1102 */             OutputObjectState state = null;
/*      */
/* 1104 */             if (tsLogger.arjLoggerI18N.isWarnEnabled())
/*      */             {
/* 1106 */               tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.StateManager_11", new Object[] { this.objectUid, type() });
/*      */             }
/*      */
/* 1115 */             if (fromTerminate)
/*      */             {
/* 1117 */               state = new OutputObjectState(this.objectUid, type());
/*      */
/* 1119 */               if (!save_state(state, this.myType))
/*      */               {
/* 1121 */                 if (tsLogger.arjLoggerI18N.isWarnEnabled()) {
/* 1122 */                   tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.StateManager_12");
/*      */                 }
/*      */
/* 1125 */                 action.preventCommit();
/*      */               }
/*      */
/*      */             }
/*      */             else
/*      */             {
/* 1132 */               action.preventCommit();
/*      */             }
/*      */
/* 1140 */             setupStore(this.storeRoot);
/*      */
/* 1142 */             record = new CadaverRecord(state, this.objectStore, this);
/*      */
/* 1144 */             if ((rStatus = action.add(record)) != 2) {
/* 1145 */               record = null;
/*      */             }
/*      */           }
/* 1148 */           if ((this.currentlyActivated) && (this.currentStatus != 4))
/*      */           {
/* 1150 */             record = new CadaverActivationRecord(this);
/*      */
/* 1152 */             if ((rStatus = action.add(record)) == 2)
/*      */             {
/* 1154 */               this.currentStatus = 0;
/*      */             }
/*      */             else {
/* 1157 */               record = null;
View Full Code Here

/*  69 */         System.exit(0);
/*     */       }
/*     */
/*     */     }
/*     */
/*  75 */     BasicAction ba = new BasicAction();
/*  76 */     String baType = ba.type();
/*  77 */     if (baType.charAt(0) == '/')
/*  78 */       baType = baType.substring(1);
/*     */     try
/*     */     {
/*  81 */       TxControl txc = new TxControl();
View Full Code Here

/*     */     }
/*     */
/* 118 */     if ((super.ObjectType() == 0) && (this.smAttributes.objectModel == 0)) {
/* 119 */       return super.modified();
/*     */     }
/* 121 */     BasicAction action = BasicAction.Current();
/*     */
/* 123 */     if ((super.ObjectType() == 2) || (super.status() == 4))
/*     */     {
/* 125 */       return true;
/*     */     }
/*     */
/* 128 */     if (super.status() == 0)
/*     */     {
/* 130 */       if (tsLogger.arjLoggerI18N.isWarnEnabled()) {
/* 131 */         tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.StateManager_10");
/*     */       }
/* 133 */       activate();
/*     */     }
/*     */
/* 140 */     if (status() == 1) {
/* 141 */       setStatus(3);
/*     */     }
/* 143 */     if (action != null)
/*     */     {
/* 151 */       synchronized (this.modifyingActions)
/*     */       {
/* 153 */         if ((this.modifyingActions.size() > 0) && (this.modifyingActions.get(action.get_uid()) != null))
/*     */         {
/* 156 */           return true;
/*     */         }
/*     */
/* 159 */         this.modifyingActions.put(action.get_uid(), action);
/*     */       }
/*     */
/* 164 */       OutputObjectState state = new OutputObjectState(this.objectUid, type());
/* 165 */       int rStatus = 2;
/*     */
/* 167 */       if (save_state(state, 0))
/*     */       {
/* 169 */         TxLogWritePersistenceRecord record = new TxLogWritePersistenceRecord(state, super.getStore(), this);
/*     */
/* 171 */         if ((rStatus = action.add(record)) != 2)
/*     */         {
/* 173 */           synchronized (this.modifyingActions)
/*     */           {
/* 175 */             this.modifyingActions.remove(action.get_uid());
/*     */           }
/*     */
/* 178 */           record = null;
/*     */
/* 180 */           return false;
View Full Code Here

/* 111 */     purgeActions();
/*     */
/* 113 */     if (act != null)
/*     */     {
/* 119 */       Stack s = new Stack();
/* 120 */       BasicAction nextLevel = act.parent();
/*     */
/* 122 */       s.push(act);
/*     */
/* 124 */       while (nextLevel != null)
/*     */       {
/* 126 */         s.push(nextLevel);
/*     */
/* 128 */         nextLevel = nextLevel.parent();
/*     */       }
/*     */
/*     */       try
/*     */       {
/* 137 */         while (!s.empty())
View Full Code Here

/*     */   {
/* 173 */     Stack txs = (Stack)_threadList.get();
/*     */
/* 175 */     if (txs != null)
/*     */     {
/* 177 */       BasicAction a = (BasicAction)txs.pop();
/*     */
/* 179 */       if ((a != null) && (unregister))
/*     */       {
/* 181 */         a.removeChildThread(threadId);
/*     */       }
/*     */
/* 184 */       if (txs.size() == 0)
/*     */       {
/* 186 */         _threadList.set(null);
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.