public void notifyTransactionCompleted(GlobalTransaction transaction, boolean successful, InvocationContext ctx) {
if (!transactionCompletedListeners.isEmpty()) {
boolean isOriginLocal = ctx.isOriginLocal();
InvocationContext contexts = icc.suspend();
try {
EventImpl e = new EventImpl();
e.setCache(cache);
e.setOriginLocal(isOriginLocal);
e.setTransactionId(transaction);
e.setTransactionSuccessful(successful);
e.setType(TRANSACTION_COMPLETED);
for (ListenerInvocation listener : transactionCompletedListeners) {
listener.invoke(e);
}
} finally {
icc.resume(contexts);