/** * create the contact item for the factory in this address space * and persist it * * Used in the original transaction-initiating process */ static boolean createAndSave(ArjunaFactory factory) { if (_theSingularItem == null) { _theSingularItem = new FactoryContactItem(factory); return _theSingularItem.saveMe(); } else { // do it only once return true; } }
/** * construct the item known by this uid from the ObjectStore (assuming * it is there - otherwise return null) * * Used in the RecoveryManager */ static FactoryContactItem recreate (Uid uid) { FactoryContactItem theItem = new FactoryContactItem(uid); if (theItem.restoreMe()) { return theItem; } else { return null; } }
/** * the address space this contact item points to has gone away */ void markAsDead() { // ignore if done previously if (_factory != null) { // the ior won't work any more, so forget it _factory = null; _deadTime = new Date(); saveMe(); } }
/** * find the IOR for the ArjunaFactory whose FactoryContactItem was saved with * this uid. It is possible this Uid was created after the last scan, so if * it isn't in the hashtable, look for real directly. */ private FactoryContactItem getItem (Uid uid) { FactoryContactItem theItem = null; theItem = getKnownItem(uid); if (theItem == null) { // not previously known - see if it exists now theItem = getNewItem(uid); if (theItem == null) { // if it's still null, either something has gone wrong // - how did it get in the recoverycoordkey when the // factory was unknown // or it's very old and been fully deleted jtsLogger.i18NLogger.warn_recovery_contact_StatusChecker_14(uid); // treat as long-dead process - return null } } return theItem; }
public ExpiredContactScanner () { if (jtsLogger.loggerI18N.isDebugEnabled()) { jtsLogger.loggerI18N.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_CRASH_RECOVERY, "com.arjuna.ats.internal.jts.recovery.ExpiredContactScanner_1", new Object[]{Integer.toString(_expiryTime)}); } _objectStore = FactoryContactItem.getStore(); _itemTypeName = FactoryContactItem.getTypeName(); }
/** * get the status in the original process, given the uid of the contact * item (which is the uid of the process) */ public static Status get_status(Uid transactionUid, Uid itemUid) throws Inactive { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("StatusChecker.get_status(" + transactionUid + ", " + itemUid + ")"); } return _checker.checkOriginalStatus(transactionUid, itemUid, true); }
private FactoryContactItem getNewItem (Uid uid) { FactoryContactItem item = FactoryContactItem.recreate(uid); if (item != null) { // enter in the uid hashtable _itemFromUid.put(uid,item); } return item; }
private static boolean removeMe(Uid uid) { try { return getStore().remove_committed(uid, _pseudoTypeName); } catch (ObjectStoreException exo) { // this shouldn't happen, because we shouldn't be looking for a factory // that was never recorded jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.recovery.contact.FactoryContactItem_7", new Object[] {exo}); } return false; }
/** * */ public Status getOriginalStatus () { if (_recoveryStatus != RecoveryStatus.ACTIVATE_FAILED) { try { return StatusChecker.get_status(get_uid(), _originalProcessUid); } catch (Inactive ex) { // shouldn't happen! return Status.StatusUnknown; } } else { // if it can't be activated, we can't get the process uid return Status.StatusUnknown; } }
public ExpiredContactScanner () { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("ExpiredContactScanner created, with expiry time of "+_expiryTime+" seconds"); } _recoveryStore = StoreManager.getRecoveryStore(); _itemTypeName = FactoryContactItem.getTypeName(); }
/** * create the contact item for the factory in this address space * and persist it * * Used in the original transaction-initiating process */ static boolean createAndSave(ArjunaFactory factory) { if (_theSingularItem == null) { _theSingularItem = new FactoryContactItem(factory); return _theSingularItem.saveMe(); } else { // do it only once return true; } }
/** * construct the item known by this uid from the ObjectStore (assuming * it is there - otherwise return null * * Used in the RecoveryManager */ static FactoryContactItem recreate (Uid uid) { FactoryContactItem theItem = new FactoryContactItem(uid); if (theItem.restoreMe()) { return theItem; } else { return null; } }
/** * find the IOR for the ArjunaFactory whose FactoryContactItem was saved with * this uid. It is possible this Uid was created after the last scan, so if * it isn't in the hashtable, look for real directly. */ private FactoryContactItem getItem (Uid uid) { FactoryContactItem theItem = null; theItem = getKnownItem(uid); if (theItem == null) { // not previously known - see if it exists now theItem = getNewItem(uid); if (theItem == null) { // if it's still null, either something has gone wrong // - how did it get in the recoverycoordkey when the // factory was unknown // or it's very old and been fully deleted jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.recovery.contact.StatusChecker_14", new Object[]{uid}); // treat as long-dead process - return null } } return theItem; }
/** * get the current status in the original process, given the uid of the contact * item (which is the uid of the process). Note that this method is used by the * GenericRecoveryCoordinator code only. */ public static Status get_current_status(Uid transactionUid, Uid itemUid) throws Inactive { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("StatusChecker.get_current_status(" + transactionUid + ", " + itemUid + ")"); } return _checker.checkOriginalStatus(transactionUid, itemUid, false); }
/** * the address space this contact item points to has gone away */ void markAsDead() { // ignore if done previously if (_factory != null) { // the ior won't work any more, so forget it _factory = null; _deadTime = new Date(); saveMe(); } }
private FactoryContactItem getNewItem (Uid uid) { FactoryContactItem item = FactoryContactItem.recreate(uid); if (item != null) { // enter in the uid hashtable _itemFromUid.put(uid,item); } return item; }
private static boolean removeMe(Uid uid) { try { return getStore().remove_committed(uid, _pseudoTypeName); } catch (ObjectStoreException exo) { // this shouldn't happen, because we shouldn't be looking for a factory // that was never recorded jtsLogger.i18NLogger.warn_recovery_contact_FactoryContactItem_7(exo); } return false; } }
/** * */ public Status getOriginalStatus () { if (_recoveryStatus != RecoveryStatus.ACTIVATE_FAILED) { try { return StatusChecker.get_status(get_uid(), _originalProcessUid); } catch (Inactive ex) { // shouldn't happen! return Status.StatusUnknown; } } else { // if it can't be activated, we can't get the process uid return Status.StatusUnknown; } }
/** * get the status in the original process, given the uid of the contact * item (which is the uid of the process) */ public static Status get_status(Uid transactionUid, Uid itemUid) throws Inactive { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_CRASH_RECOVERY, "StatusChecker.get_status("+transactionUid+", "+itemUid+")"); } return _checker.checkOriginalStatus(transactionUid, itemUid, true); }
/** * get the current status in the original process, given the uid of the contact * item (which is the uid of the process). Note that this method is used by the * GenericRecoveryCoordinator code only. */ public static Status get_current_status(Uid transactionUid, Uid itemUid) throws Inactive { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_CRASH_RECOVERY, "StatusChecker.get_current_status("+transactionUid+", "+itemUid+")"); } return _checker.checkOriginalStatus(transactionUid, itemUid, false); }