use of com.arjuna.ats.arjuna.recovery.RecoveryModule in project narayana by jbosstm.
the class RecoveryManagerService method addSerializableXAResourceDeserializer.
public void addSerializableXAResourceDeserializer(SerializableXAResourceDeserializer serializableXAResourceDeserializer) {
XARecoveryModule xaRecoveryModule = null;
for (RecoveryModule recoveryModule : ((Vector<RecoveryModule>) _recoveryManager.getModules())) {
if (recoveryModule instanceof XARecoveryModule) {
xaRecoveryModule = (XARecoveryModule) recoveryModule;
break;
}
}
if (xaRecoveryModule == null) {
throw new IllegalStateException(jbossatxLogger.i18NLogger.get_jta_RecoveryManagerService_norecoverymodule());
}
xaRecoveryModule.addSerializableXAResourceDeserializer(serializableXAResourceDeserializer);
}
use of com.arjuna.ats.arjuna.recovery.RecoveryModule in project narayana by jbosstm.
the class RecoveryManagerService method removeXAResourceRecovery.
public void removeXAResourceRecovery(XAResourceRecovery xaResourceRecovery) {
if (_recoveryManager == null) {
throw new IllegalStateException(jbossatxLogger.i18NLogger.get_jta_RecoveryManagerService_norecoverysystem());
}
XARecoveryModule xaRecoveryModule = null;
for (RecoveryModule recoveryModule : ((Vector<RecoveryModule>) _recoveryManager.getModules())) {
if (recoveryModule instanceof XARecoveryModule) {
xaRecoveryModule = (XARecoveryModule) recoveryModule;
break;
}
}
if (xaRecoveryModule == null) {
throw new IllegalStateException(jbossatxLogger.i18NLogger.get_jta_RecoveryManagerService_norecoverymodule());
}
xaRecoveryModule.removeXAResourceRecoveryHelper(new XAResourceRecoveryHelperWrapper(xaResourceRecovery));
}
use of com.arjuna.ats.arjuna.recovery.RecoveryModule in project narayana by jbosstm.
the class XAResourceRecord method getXAResourceDeserializers.
private List<SerializableXAResourceDeserializer> getXAResourceDeserializers() {
if (serializableXAResourceDeserializers != null) {
return serializableXAResourceDeserializers;
}
synchronized (this) {
if (serializableXAResourceDeserializers != null) {
return serializableXAResourceDeserializers;
}
serializableXAResourceDeserializers = new ArrayList<SerializableXAResourceDeserializer>();
for (RecoveryModule recoveryModule : RecoveryManager.manager().getModules()) {
if (recoveryModule instanceof XARecoveryModule) {
XARecoveryModule xaRecoveryModule = (XARecoveryModule) recoveryModule;
serializableXAResourceDeserializers.addAll(xaRecoveryModule.getSeriablizableXAResourceDeserializers());
return serializableXAResourceDeserializers;
}
}
}
return serializableXAResourceDeserializers;
}
use of com.arjuna.ats.arjuna.recovery.RecoveryModule in project narayana by jbosstm.
the class XARecoveryModule method getRegisteredXARecoveryModule.
public static XARecoveryModule getRegisteredXARecoveryModule() {
if (registeredXARecoveryModule == null) {
RecoveryManager recMan = RecoveryManager.manager();
Vector recoveryModules = recMan.getModules();
if (recoveryModules != null) {
Enumeration modules = recoveryModules.elements();
while (modules.hasMoreElements()) {
RecoveryModule m = (RecoveryModule) modules.nextElement();
if (m instanceof XARecoveryModule) {
registeredXARecoveryModule = (XARecoveryModule) m;
break;
}
}
}
}
return registeredXARecoveryModule;
}
use of com.arjuna.ats.arjuna.recovery.RecoveryModule in project narayana by jbosstm.
the class SubordinateAtomicActionRecoveryModule method validatePosition.
/**
* It is important to verify that the SubordinateAtomicActionRecoveryModule has been loaded before the XARecoveryModule
* as otherwise when we check for an imported transaction it may not have been loaded by the SubordinateAtomicActionRecoveryModule yet.
*
* @return true if and only if SubordinateAtomicActionRecoveryModule appears before XARecoveryModule in the modules
*/
private boolean validatePosition() {
if (!this.validatePosition) {
Vector<RecoveryModule> modules = RecoveryManager.manager().getModules();
boolean foundSelf = false;
for (RecoveryModule module : modules) {
if (module instanceof SubordinateAtomicActionRecoveryModule) {
foundSelf = true;
} else if (module instanceof XARecoveryModule) {
// configured to run before it
if (!foundSelf) {
return false;
} else {
this.validatePosition = true;
break;
}
}
}
}
return this.validatePosition;
}
Aggregations