if (invocation != null) {
String methodName = invocation.getMethodName();
preProcessAttributeConsumers(bean, invocation);
if (methodName.equals(COMMIT_TXN)) {
TransactionMgr.commitTransaction();
result = new RemoteInvocationResultWrapper("Commit successful");
terminateThread = true;
}
else if (methodName.equals(ROLLBACK_TXN)) {
TransactionMgr.rollbackTransaction();
result = new RemoteInvocationResultWrapper("Rollback successful");
terminateThread = true;
}
else if (methodName.equals(ABORT_TXN)) {
TransactionMgr.abort();
result = new RemoteInvocationResultWrapper("Abort successful");
terminateThread = true;
}
else {
result = new RemoteInvocationResultWrapper(invocation.invoke(targetObject));
}
wasAborted = TransactionMgr.isAborted();
postProcessAttributeProviders(invocation, result, bean, targetObject);
// We also need to add an attribute which says if the distributed transaction
// was aborted or not. If it was, then we can kill this thread after we've returned