// If we're the current invoker, then this must have been caused by the remote invocation
// to which current invoker points aborting the transaction, in which case we don't neeed
// to re-tell it to abort the transaction
if (invokerObject != rootData.currentInvoker) {
if (invokerObject instanceof HttpInvokerClientConfiguration) {
HttpInvokerClientConfiguration invoker = (HttpInvokerClientConfiguration)invokerObject;
HttpInvokerRequestExecutor nestedHttpInvokerRequestExecutor = new SimpleHttpInvokerRequestExecutor();
RemoteInvocation call = new RemoteInvocation(ABORT_TXN, new Class<?>[0], new Object[0]);
call.addAttribute(TXN_ID, rootData.distributedTransactionID);
try {
nestedHttpInvokerRequestExecutor.executeRequest(invoker, call);
}
catch (Exception e) {
_log.error("Aborting distributed transaction failed", e);
}
}
else if (invokerObject instanceof ServiceProxy) {
ServiceProxy invoker = (ServiceProxy)invokerObject;
FrameworkUtils.setAppContext(TXN_ID, rootData.distributedTransactionID);
try {
invoker.intercept(ABORT_TXN, (Object[])null);
}
catch (Exception e) {
_log.error("Aborting distributed transaction failed", e);
}
FrameworkUtils.setAppContext(TXN_ID, null);