Пример #1
0
 @Override
 public void notifyTransactionRegistered(
     GlobalTransaction globalTransaction, InvocationContext ctx) {
   if (!transactionRegisteredListeners.isEmpty()) {
     boolean isOriginLocal = ctx.isOriginLocal();
     EventImpl<Object, Object> e = EventImpl.createEvent(cache, TRANSACTION_REGISTERED);
     e.setOriginLocal(isOriginLocal);
     e.setTransactionId(globalTransaction);
     for (ListenerInvocation listener : transactionRegisteredListeners) listener.invoke(e);
   }
 }
Пример #2
0
 @Override
 public void notifyTransactionCompleted(
     GlobalTransaction transaction, boolean successful, InvocationContext ctx) {
   if (!transactionCompletedListeners.isEmpty()) {
     boolean isOriginLocal = ctx.isOriginLocal();
     EventImpl<Object, Object> e = EventImpl.createEvent(cache, TRANSACTION_COMPLETED);
     e.setOriginLocal(isOriginLocal);
     e.setTransactionId(transaction);
     e.setTransactionSuccessful(successful);
     for (ListenerInvocation listener : transactionCompletedListeners) listener.invoke(e);
   }
 }
Пример #3
0
 private void setTx(InvocationContext ctx, EventImpl<Object, Object> e) {
   if (ctx != null && ctx.isInTxScope()) {
     GlobalTransaction tx = ((TxInvocationContext) ctx).getGlobalTransaction();
     e.setTransactionId(tx);
   }
 }