/** * 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; } }
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(); }
private FactoryContactItem getNewItem (Uid uid) { FactoryContactItem item = FactoryContactItem.recreate(uid); if (item != null) { // enter in the uid hashtable _itemFromUid.put(uid,item); } return item; }
/** * 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; } }
ArjunaFactory factory = item.getFactory(); item.markAsAlive(); } catch ( NO_IMPLEMENT ex_noimp) { item.markAsDead();
private boolean saveMe () { try { OutputObjectState objstate = new OutputObjectState(); if (save_state(objstate)) { getStore().write_committed(_uid, _pseudoTypeName, objstate); return true; } } catch (ObjectStoreException exo) { jtsLogger.i18NLogger.warn_recovery_contact_FactoryContactItem_1(exo); } return false; }
private boolean restoreMe() { try { InputObjectState objstate = getStore().read_committed(_uid, _pseudoTypeName); if (objstate == null) // not in object store any more return false; if ( restore_state(objstate)) { return true; } jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.recovery.contact.FactoryContactItem_5"); } 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_6"); } return false; }
FactoryContactItem anItem = FactoryContactItem.recreate(newUid); if (anItem != null) Date timeOfDeath = anItem.getDeadTime(); if (timeOfDeath != null && timeOfDeath.before(oldestSurviving))
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 void connected (org.omg.CORBA.Object obj) { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("RecoveryContactWriter.connected("+obj+")"); } // only do this once - but shouldn't need this, since de-register on writing if (_noted) { return; } try { ArjunaFactory theFactory = ArjunaFactoryHelper.narrow(obj); if (theFactory != null) { // if that didn't blow, we have a hit if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("RecoveryContactWriter.connected - found ArjunaFactory"); } FactoryContactItem.createAndSave(theFactory); // we've done our work, so set the flag and try to remove ourselves _noted = true; EventManager.getManager().removeHandler(this); } } catch ( Exception ex) { // oh well - it probably wasn't ours } }
public ExpiredContactScanner () { if (jtsLogger.logger.isDebugEnabled()) { jtsLogger.logger.debug("ExpiredContactScanner created, with expiry time of "+_expiryTime+" seconds"); } _recoveryStore = StoreManager.getRecoveryStore(); _itemTypeName = FactoryContactItem.getTypeName(); }
ArjunaFactory factory = item.getFactory(); item.markAsAlive(); } catch ( NO_IMPLEMENT ex_noimp) { item.markAsDead();
private boolean saveMe () { try { OutputObjectState objstate = new OutputObjectState(); if (save_state(objstate)) { getStore().write_committed(_uid, _pseudoTypeName, objstate); return true; } } catch (ObjectStoreException exo) { jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.recovery.contact.FactoryContactItem_1", new Object[] {exo}); } return false; }
/** * 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; } }
private boolean restoreMe() { try { InputObjectState objstate = getStore().read_committed(_uid, _pseudoTypeName); if (objstate == null) // not in object store any more return false; if (restore_state(objstate)) { return true; } jtsLogger.i18NLogger.warn_recovery_contact_FactoryContactItem_5(); } 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_6(); } return false; }
FactoryContactItem anItem = FactoryContactItem.recreate(newUid); if (anItem != null) Date timeOfDeath = anItem.getDeadTime(); if (timeOfDeath != null && timeOfDeath.before(oldestSurviving))
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; } }
FactoryContactItem.createAndSave(theFactory);
/** * 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; } }
private FactoryContactItem getNewItem (Uid uid) { FactoryContactItem item = FactoryContactItem.recreate(uid); if (item != null) { // enter in the uid hashtable _itemFromUid.put(uid,item); } return item; }