use of com.arjuna.ArjunaOTS.OTSAbstractRecord in project narayana by jbosstm.
the class ExtendedResourceRecord method otsRecord.
private final OTSAbstractRecord otsRecord(AbstractRecord absRec) {
/*
* Is the abstract record an ExtendedResourceRecord ?
*/
OTSAbstractRecord resHandle = null;
if ((absRec != null) && (absRec instanceof ExtendedResourceRecord)) {
try {
ExtendedResourceRecord theRecord = (ExtendedResourceRecord) absRec;
ArjunaSubtranAwareResource theResource = theRecord.resourceHandle();
resHandle = com.arjuna.ArjunaOTS.OTSAbstractRecordHelper.unchecked_narrow(theResource);
theResource = null;
} catch (Exception e) {
jtsLogger.i18NLogger.warn_resources_errgenerr("ExtendedResourceRecord.otsRecord", e);
}
}
return resHandle;
}
use of com.arjuna.ArjunaOTS.OTSAbstractRecord in project narayana by jbosstm.
the class ExtendedResourceRecord method typeIs.
public int typeIs() {
OTSAbstractRecord resHandle = otsRecord();
int r = RecordType.OTS_ABSTRACTRECORD;
if (_cachedType == -1) {
try {
if ((resHandle != null) && !_endpointFailed)
_cachedType = r = resHandle.type_id();
} catch (Exception e) {
r = RecordType.OTS_ABSTRACTRECORD;
_endpointFailed = true;
jtsLogger.i18NLogger.warn_resources_errtypefail("ExtendedResourceRecord.typeIs", Integer.toString(r));
}
} else
r = _cachedType;
resHandle = null;
return r;
}
use of com.arjuna.ArjunaOTS.OTSAbstractRecord in project narayana by jbosstm.
the class ExtendedResourceRecord method shouldAlter.
public boolean shouldAlter(AbstractRecord absRec) {
boolean result = false;
OTSAbstractRecord resHandle = otsRecord();
if ((resHandle != null) && !_endpointFailed) {
OTSAbstractRecord rec = otsRecord(absRec);
if (rec != null) {
try {
result = resHandle.shouldAlter(rec);
} catch (OBJECT_NOT_EXIST ex) {
// This is expected to happen whenever a resource has gone away, for example during a crash or if it has exited the 2PC process early by returning XA_RDONLY out of prepare
} catch (Exception e) {
_endpointFailed = true;
jtsLogger.i18NLogger.warn_resources_errgenerr("ExtendedResourceRecord.shouldAlter", e);
}
rec = null;
}
}
resHandle = null;
return result;
}
use of com.arjuna.ArjunaOTS.OTSAbstractRecord in project narayana by jbosstm.
the class ExtendedResourceRecord method shouldMerge.
public boolean shouldMerge(AbstractRecord absRec) {
boolean result = false;
OTSAbstractRecord resHandle = otsRecord();
if ((resHandle != null) && !_endpointFailed) {
OTSAbstractRecord rec = otsRecord(absRec);
if (rec != null) {
try {
result = resHandle.shouldMerge(rec);
} catch (OBJECT_NOT_EXIST ex) {
// This is expected to happen whenever a resource has gone away, for example during a crash or if it has exited the 2PC process early by returning XA_RDONLY out of prepare
} catch (Exception e) {
_endpointFailed = true;
jtsLogger.i18NLogger.warn_resources_errgenerr("ExtendedResourceRecord.shouldMerge", e);
}
rec = null;
}
}
resHandle = null;
return result;
}
use of com.arjuna.ArjunaOTS.OTSAbstractRecord in project narayana by jbosstm.
the class ExtendedResourceRecord method shouldReplace.
public boolean shouldReplace(AbstractRecord absRec) {
boolean result = recoveryReplace(absRec);
OTSAbstractRecord resHandle = otsRecord();
if ((resHandle != null) && !result && !_endpointFailed) {
OTSAbstractRecord rec = otsRecord(absRec);
if (rec != null) {
try {
result = resHandle.shouldReplace(rec);
} catch (OBJECT_NOT_EXIST ex) {
// This is expected to happen whenever a resource has gone away, for example during a crash or if it has exited the 2PC process early by returning XA_RDONLY out of prepare
} catch (Exception e) {
_endpointFailed = true;
jtsLogger.i18NLogger.warn_resources_errgenerr("ExtendedResourceRecord.shouldReplace", e);
}
rec = null;
}
}
resHandle = null;
return result;
}
Aggregations