use of com.arjuna.ats.arjuna.coordinator.BasicAction in project narayana by jbosstm.
the class ArjunaTransactionImple method is_descendant_transaction.
/**
* Is this transaction a descendant of tc?
*/
public boolean is_descendant_transaction(Coordinator tc) throws SystemException {
if (tc == null)
return false;
try {
UidCoordinator ptr = com.arjuna.ArjunaOTS.UidCoordinatorHelper.narrow(tc);
if (ptr != null) {
/*
* Must be an Arjuna coordinator.
*/
Uid lookingFor = new Uid(ptr.uid());
BasicAction lookingAt = this;
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ArjunaTransactionImple::is_descendant_transaction - looking for " + lookingFor);
}
while (lookingAt != null) {
if (jtsLogger.logger.isTraceEnabled()) {
jtsLogger.logger.trace("ArjunaTransactionImple::is_descendant_transaction - looking for " + lookingAt.get_uid());
}
if (lookingAt.get_uid().equals(lookingFor))
return true;
else
lookingAt = lookingAt.parent();
}
ptr = null;
} else
throw new BAD_PARAM();
} catch (SystemException e) {
/*
* Narrow failed, so can't be an Arjuna Uid. Therefore, the answer
* must be false.
*/
}
return false;
}
use of com.arjuna.ats.arjuna.coordinator.BasicAction in project narayana by jbosstm.
the class Helper method localAction.
/**
* Given a Control_ptr determine if this is a reference to a local
* action, and if so return the raw BasicAction pointer.
*/
public static final BasicAction localAction(org.omg.CosTransactions.Control control) {
if (control == null)
return null;
if (control instanceof ControlImple) {
try {
ControlImple c = (ControlImple) control;
return (BasicAction) c.getImplHandle();
} catch (Exception e) {
}
}
try {
UidCoordinator coord = Helper.getUidCoordinator(control);
if (coord != null) {
Uid u = Helper.getUid(coord);
coord = null;
return ActionManager.manager().get(u);
} else
throw new BAD_PARAM();
} catch (Exception e) {
/*
* Can't be an Arjuna action, so ignore.
*/
}
return null;
}
Aggregations