if (participantRecoveryRecord.isActive()) { XTSATRecoveryModule module = moduleIterator.next(); try { if (participantRecoveryRecord.restoreParticipant(module)) { participantRecoveryRecord.activate(); RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_3(participantRecoveryRecord.getId(), e); RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_4(participantRecoveryRecord.getId());
/** * save the supplied participant recovery record to persistent storage * * @param participantRecoveryRecord */ public boolean writeParticipantRecoveryRecord(ATParticipantRecoveryRecord participantRecoveryRecord) { OutputObjectState oos = new OutputObjectState(); // we need to be able to retrieve the class of the participant record so we can // create an instancde to load the rest of the participant specific data try { oos.packString(participantRecoveryRecord.getClass().getCanonicalName()); } catch (IOException ioe) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_1(participantRecoveryRecord.getId(), ioe); return false; } if (participantRecoveryRecord.saveState(oos)) { Uid uid = new Uid(); try { txLog.write_committed(uid, type, oos); // we need to be able to identify the uid from the participant id // in order to delete it later uidMap.put(participantRecoveryRecord.getId(), uid); return true; } catch (ObjectStoreException ose) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_1(participantRecoveryRecord.getId(), ose); } } return false; }
public ATParticipantRecoveryModule() { if (RecoveryLogger.logger.isDebugEnabled()) { RecoveryLogger.logger.debug("ATParticipantRecoveryModule created - default"); } if (_recoveryStore == null) { _recoveryStore = StoreManager.getRecoveryStore(); } _participantType = ATParticipantRecoveryRecord.type(); }
/** * add a recovered participant record to the table of unrecovered participants which * need to be recreated following recovery * * @param uid the uid under which the participant was saved in the file store * @param participantRecoveryRecord the in-memory representation of the recovery record * saved to disk */ public void addParticipantRecoveryRecord(Uid uid, ATParticipantRecoveryRecord participantRecoveryRecord) { String participantId = participantRecoveryRecord.getId(); if (recoveryMap.get(participantId) == null && !participantRecoveryRecord.isActive()) { // ok, we have not seen this entry before so add it to the list recoveryMap.put(participantId, participantRecoveryRecord); uidMap.put(participantId, uid); } }
/** * Restore the state of the particpant from the specified input object stream. * * @param ios The Input object stream. * @return true if restored, false otherwise. * */ public boolean restoreState(InputObjectState ios) { try { id = ios.unpackString(); restoreEndpointReference(ios); recoveryStateValid = ios.unpackBoolean(); if (recoveryStateValid) { useSerialization = ios.unpackBoolean(); if (ios.unpackBoolean()) { recoveryState = ios.unpackBytes(); } else { recoveryState = null; } } } catch (XMLStreamException xmle) { WSTLogger.i18NLogger.warn_recovery_participant_at_ATParticipantRecoveryRecord_restoreState_1(id, xmle); return false; } catch (IOException ioe) { WSTLogger.i18NLogger.warn_recovery_participant_at_ATParticipantRecoveryRecord_restoreState_2(id, ioe); return false; } return true; }
saveEndpointReference(oos); oos.packBoolean(recoveryStateValid); if (recoveryStateValid) {
participantRecord.restoreState(inputState);
/** * add a recovered participant record to the table of unrecovered participants which * need to be recreated following recovery * * @param uid the uid under which the participant was saved in the file store * @param participantRecoveryRecord the in-memory representation of the recovery record * saved to disk */ public void addParticipantRecoveryRecord(Uid uid, ATParticipantRecoveryRecord participantRecoveryRecord) { String participantId = participantRecoveryRecord.getId(); if (recoveryMap.get(participantId) == null && !participantRecoveryRecord.isActive()) { // ok, we have not seen this entry before so add it to the list recoveryMap.put(participantId, participantRecoveryRecord); uidMap.put(participantId, uid); } }
/** * Restore the state of the particpant from the specified input object stream. * * @param ios The Input object stream. * @return true if restored, false otherwise. * */ public boolean restoreState(InputObjectState ios) { try { id = ios.unpackString(); restoreEndpointReference(ios); recoveryStateValid = ios.unpackBoolean(); if (recoveryStateValid) { useSerialization = ios.unpackBoolean(); if (ios.unpackBoolean()) { recoveryState = ios.unpackBytes(); } else { recoveryState = null; } } } catch (XMLStreamException xmle) { WSTLogger.i18NLogger.warn_recovery_participant_at_ATParticipantRecoveryRecord_restoreState_1(id, xmle); return false; } catch (IOException ioe) { WSTLogger.i18NLogger.warn_recovery_participant_at_ATParticipantRecoveryRecord_restoreState_2(id, ioe); return false; } return true; }
saveEndpointReference(oos); oos.packBoolean(recoveryStateValid); if (recoveryStateValid) {
participantRecord.restoreState(inputState);
if (participantRecoveryRecord.isActive()) { XTSATRecoveryModule module = moduleIterator.next(); try { if (participantRecoveryRecord.restoreParticipant(module)) { participantRecoveryRecord.activate(); RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_3(participantRecoveryRecord.getId(), e); RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_4(participantRecoveryRecord.getId());
/** * add a recovered participant record to the table of unrecovered participants which * need to be recreated following recovery * * @param uid the uid under which the participant was saved in the file store * @param participantRecoveryRecord the in-memory representation of the recovery record * saved to disk */ public void addParticipantRecoveryRecord(Uid uid, ATParticipantRecoveryRecord participantRecoveryRecord) { String participantId = participantRecoveryRecord.getId(); if (recoveryMap.get(participantId) == null && !participantRecoveryRecord.isActive()) { // ok, we have not seen this entry before so add it to the list recoveryMap.put(participantId, participantRecoveryRecord); uidMap.put(participantId, uid); } }
/** * save the supplied participant recovery record to persistent storage * * @param participantRecoveryRecord */ public boolean writeParticipantRecoveryRecord(ATParticipantRecoveryRecord participantRecoveryRecord) { OutputObjectState oos = new OutputObjectState(); // we need to be able to retrieve the class of the participant record so we can // create an instancde to load the rest of the participant specific data try { oos.packString(participantRecoveryRecord.getClass().getCanonicalName()); } catch (IOException ioe) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_1(participantRecoveryRecord.getId(), ioe); return false; } if (participantRecoveryRecord.saveState(oos)) { Uid uid = new Uid(); try { txLog.write_committed(uid, type, oos); // we need to be able to identify the uid from the participant id // in order to delete it later uidMap.put(participantRecoveryRecord.getId(), uid); return true; } catch (ObjectStoreException ose) { RecoveryLogger.i18NLogger.warn_participant_at_XTSATRecoveryModule_1(participantRecoveryRecord.getId(), ose); } } return false; }
public ATParticipantRecoveryModule() { if (RecoveryLogger.logger.isDebugEnabled()) { RecoveryLogger.logger.debug("ATParticipantRecoveryModule created - default"); } if (_recoveryStore == null) { _recoveryStore = StoreManager.getRecoveryStore(); } _participantType = ATParticipantRecoveryRecord.type(); }
/** * Restore the state of the particpant from the specified input object stream. * * @param ios The Input object stream. * @return true if restored, false otherwise. * */ public boolean restoreState(InputObjectState ios) { try { id = ios.unpackString(); restoreEndpointReference(ios); recoveryStateValid = ios.unpackBoolean(); if (recoveryStateValid) { useSerialization = ios.unpackBoolean(); if (ios.unpackBoolean()) { recoveryState = ios.unpackBytes(); } else { recoveryState = null; } } } catch (XMLStreamException xmle) { WSTLogger.i18NLogger.warn_recovery_participant_at_ATParticipantRecoveryRecord_restoreState_1(id, xmle); return false; } catch (IOException ioe) { WSTLogger.i18NLogger.warn_recovery_participant_at_ATParticipantRecoveryRecord_restoreState_2(id, ioe); return false; } return true; }
saveEndpointReference(oos); oos.packBoolean(recoveryStateValid); if (recoveryStateValid) {