/** * Gets a reference to the Object Store. */ public TransactionStatusConnectionManager() { if ( _recoveryStore == null ) { _recoveryStore = StoreManager.getRecoveryStore(); } updateTSMI() ; }
private final void setObjectStore() { if (_participantStore == null) _participantStore = StoreManager.getParticipantStore(); }
public static ObjectStoreAPI getEISNameStore() { return (ObjectStoreAPI) setupStore(null, StateType.OS_UNSHARED); } }
private static Set<Uid> getUids(Set<Uid> uids, String type) { try { RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); InputObjectState states = new InputObjectState(); if (recoveryStore.allObjUids(type, states) && states.notempty()) { boolean finished = false; do { Uid uid = UidHelper.unpackFrom(states); if (uid.notEquals(Uid.nullUid())) { uids.add(uid); } else { finished = true; } } while (!finished); } } catch (Exception e) { e.printStackTrace(); } return uids; }
public boolean doRemove() { try { if (StoreManager.getRecoveryStore().remove_committed(getUid(), _uidWrapper.getType())) return true; if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s", REMOVE_NOK_1, getUid().toString()); return false; } catch (ObjectStoreException e) { if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s - %s", REMOVE_NOK_1, getUid().toString(), e.getMessage()); return false; } }
public AtomicActionRecoveryModule() { if (tsLogger.logger.isDebugEnabled()) { tsLogger.logger.debug("AtomicActionRecoveryModule created"); } if (_recoveryStore == null) { _recoveryStore = StoreManager.getRecoveryStore(); } _transactionStatusConnectionMgr = new TransactionStatusConnectionManager() ; }
private Collection<Uid> getUids(String type) { Collection<Uid> uids = new ArrayList<Uid>(); ObjectStoreIterator iter = new ObjectStoreIterator(StoreManager.getRecoveryStore(), type); while (true) { Uid u = iter.iterate(); if (u == null || Uid.nullUid().equals(u)) break; uids.add(u); } return uids; }
public void removeParticipantInformation(final ParticipantInformation participantInformation) { if (LOG.isTraceEnabled()) { LOG.trace("RecoveryManager.removeParticipantInformation: participantInformation=" + participantInformation); } final RecoveryStore recoveryStore = StoreManager.getRecoveryStore(); final Uid uid = new Uid(participantInformation.getId()); try { recoveryStore.remove_committed(uid, PARTICIPANT_INFORMATION_RECORD_TYPE); } catch (ObjectStoreException e) { LOG.warn("Failure while removing participant information from the object store.", e); } }
private final synchronized void initialise () { if (!_initialised) { _initialised = true; if (!_runWithoutDaemon) { try { ParticipantStore participantStore = StoreManager.getCommunicationStore(); InputObjectState iState = participantStore.read_committed(new Uid( JacOrbRCServiceInit.uid4Recovery), JacOrbRCServiceInit.type()); if (iState != null) ref_ReCoo = iState.unpackString(); else jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4(); } catch (java.io.FileNotFoundException ex) { jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4(); } catch (Exception ex) { jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_5(ex); } } } }
public SubordinateAtomicAction(Uid actId, boolean peekXidOnly) throws ObjectStoreException, IOException { super(actId); if (peekXidOnly) { InputObjectState os = StoreManager.getParticipantStore().read_committed(objectUid, type()); unpackHeader(os, new Header()); boolean haveXid = os.unpackBoolean(); if (haveXid) { _theXid = new XidImple(); ((XidImple) _theXid).unpackFrom(os); _parentNodeName = os.unpackString(); } } else { _activated = activate(); } }
/** * Remove this AtomicAction from the ObjectStore * @return a textual indication of whether the remove operation succeeded */ public String remove() { try { if (!StoreManager.getRecoveryStore().remove_committed(getUid(), getType())) return "Attempt to remove transaction failed"; else w.probe(); return "Transaction successfully removed"; } catch (ObjectStoreException e) { return "Unable to remove transaction: " + e.getMessage(); } }
private boolean containsCommitMarkableResourceRecord(Uid u) throws ObjectStoreException, IOException { InputObjectState state = StoreManager.getRecoveryStore().read_committed( u, RecoverConnectableAtomicAction.CONNECTABLE_ATOMIC_ACTION_TYPE); if (state != null) { RecoverConnectableAtomicAction rcaa = new RecoverConnectableAtomicAction(RecoverConnectableAtomicAction.CONNECTABLE_ATOMIC_ACTION_TYPE, u, state); return (rcaa.containsIncompleteCommitMarkableResourceRecord() || rcaa.wasConfirmedCommitted()); } return false; }
public static final ParticipantStore getCommunicationStore() { if(communicationStore != null) { return communicationStore; } synchronized(StoreManager.class) { if(communicationStore != null) { return communicationStore; } communicationStore = initStore("communicationStore"); } return communicationStore; }
public static final RecoveryStore getRecoveryStore () { return getActionStore(); }
/** * Get a reference to the Object Store. */ private static ParticipantStore getStore() { return StoreManager.getCommunicationStore(); }
/** * Create the module to scan in the default location for object states. Any * modifications to locations must occur in the properties file. */ @SuppressWarnings("unchecked") public TORecoveryModule() { if (txojLogger.logger.isDebugEnabled()) { txojLogger.logger.debug("TORecoveryModule created"); } /* * Where are TO's stored. Default. */ _objectStore = StoreManager.getTxOJStore(); }
private final void listLogs (String type) throws IOException { InputObjectState buff = new InputObjectState(); try { if (StoreManager.getRecoveryStore().allObjUids(type, buff)) { Uid u = null; do { u = UidHelper.unpackFrom(buff); if (Uid.nullUid().notEquals(u)) { System.out.println("Log: " + u); } } while (Uid.nullUid().notEquals(u)); } } catch (final ObjectStoreException ex) { throw new IOException(); } }
public boolean doRemove() { try { if (StoreManager.getRecoveryStore().remove_committed(getUid(), _uidWrapper.getType())) return true; if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s", REMOVE_NOK_1, getUid().toString()); return false; } catch (ObjectStoreException e) { if (tsLogger.logger.isDebugEnabled()) tsLogger.logger.debugf("%s %s - %s", REMOVE_NOK_1, getUid().toString(), e.getMessage()); return false; } }
public AtomicActionRecoveryModule() { if (tsLogger.logger.isDebugEnabled()) { tsLogger.logger.debug("AtomicActionRecoveryModule created"); } if (_recoveryStore == null) { _recoveryStore = StoreManager.getRecoveryStore(); } _transactionStatusConnectionMgr = new TransactionStatusConnectionManager() ; }
public static final ParticipantStore getCommunicationStore() { if(communicationStore != null) { return communicationStore; } synchronized(StoreManager.class) { if(communicationStore != null) { return communicationStore; } communicationStore = initStore("communicationStore"); } return communicationStore; }