Examples of RemoteTxInvocationContext


Examples of org.infinispan.context.impl.RemoteTxInvocationContext

   @Override
   public Object perform(InvocationContext ignored) throws Throwable {
      if (ignored != null)
         throw new IllegalStateException("Expected null context!");

      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext(getOrigin());
      RemoteTransaction transaction = txTable.getRemoteTransaction(globalTx);

      if (transaction == null) {
         if (unlock) {
            if (log.isTraceEnabled()) {
               log.tracef("Unlock for non-existant transaction %s.  Not doing anything.", globalTx);
            }
            return null;
         }
         //create a remote tx without any modifications (we do not know modifications ahead of time)
         transaction = txTable.createRemoteTransaction(globalTx, null);
      }
      ctxt.setRemoteTransaction(transaction);
      TxInvocationContext ctx = ctxt;
      if (flags != null && !flags.isEmpty()) {
         ctx = new TransactionalInvocationContextFlagsOverride(ctxt, flags);
      }
      return invoker.invoke(ctx, this);
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

          */
         remoteTransaction.setModifications(getModifications());
      }

      // 2. then set it on the invocation context
      RemoteTxInvocationContext ctx = icc.createRemoteTxInvocationContext();
      ctx.setRemoteTransaction(remoteTransaction);

      if (trace)
         log.trace("Invoking remotely originated prepare: " + this + " with invocation context: " + ctx);
      notifier.notifyTransactionRegistered(ctx.getGlobalTransaction(), ctx);
      try {
         return invoker.invoke(ctx, this);
      } finally {
         if (this.isOnePhaseCommit()) {
            txTable.removeRemoteTransaction(globalTx);
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

   @Override
   public Object perform(InvocationContext ignored) throws Throwable {
      if (ignored != null)
         throw new IllegalStateException("Expected null context!");

      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext();
      RemoteTransaction transaction = txTable.getRemoteTransaction(globalTx);

      if (transaction == null) {
         if (unlock) {
            if (log.isTraceEnabled()) {
               log.trace("Unlock for non-existant transaction " + globalTx + ". Not doing anything.");
            }
            return null;
         }
         //create a remote tx without any modifications (we do not know modifications ahead of time)
         transaction = txTable.createRemoteTransaction(globalTx);
      }
      ctxt.setRemoteTransaction(transaction);
      return invoker.invoke(ctxt, this);
   }
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

   @Override
   public Object perform(InvocationContext ignored) throws Throwable {
      if (ignored != null)
         throw new IllegalStateException("Expected null context!");

      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext();
      RemoteTransaction transaction = txTable.getRemoteTransaction(globalTx);

      boolean remoteTxinitiated = transaction != null;
      if (!remoteTxinitiated) {
         //create a remote tx without any modifications (we do not know modifications ahead of time)
         transaction = txTable.createRemoteTransaction(globalTx);
      }
      ctxt.setRemoteTransaction(transaction);
      return invoker.invoke(ctxt, this);
   }
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

      RemoteTransaction transaction = txTable.getRemoteTransaction(globalTx);
      if (transaction == null) {
         if (trace) log.info("Not found RemoteTransaction for tx id: " + globalTx);
         return null;
      }
      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext();
      ctxt.setRemoteTransaction(transaction);
      try {
         if (trace) log.trace("About to execute tx command :" + this);
         return invoker.invoke(ctxt, this);
      } finally {
         txTable.removeRemoteTransaction(globalTx);
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

          */
         remoteTransaction.setModifications(modifications);
      }

      // 2. then set it on the invocation context
      RemoteTxInvocationContext ctx = icc.createRemoteTxInvocationContext();
      ctx.setRemoteTransaction(remoteTransaction);

      if (trace)
         log.trace("Invoking remotly orginated prepare: " + this);
      notifier.notifyTransactionRegistered(ctx.getGlobalTransaction(), ctx);
      try {
         return invoker.invoke(ctx, this);
      } finally {
         if (this.isOnePhaseCommit()) {
            txTable.removeRemoteTransaction(globalTx);
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

      if (transaction == null) {
         if (trace) log.trace("Did not find a RemoteTransaction for %s", globalTx);
         return invalidRemoteTxReturnValue();
      }
      visitRemoteTransaction(transaction);
      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext();
      ctxt.setRemoteTransaction(transaction);

      try {
         if (trace) log.trace("About to execute tx command " + this);
         return invoker.invoke(ctxt, this);
      } finally {
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

      if (transaction == null || transaction.isMissingModifications()) {
         if (trace) log.tracef("Did not find a RemoteTransaction for %s", globalTx);
         return invalidRemoteTxReturnValue();
      }
      visitRemoteTransaction(transaction);
      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext(
            transaction, getOrigin());

      if (trace) log.tracef("About to execute tx command %s", this);
      return invoker.invoke(ctxt, this);
   }
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

   @Override
   public Object perform(InvocationContext ignored) throws Throwable {
      if (ignored != null)
         throw new IllegalStateException("Expected null context!");

      RemoteTxInvocationContext ctxt = icc.createRemoteTxInvocationContext();
      RemoteTransaction transaction = txTable.getRemoteTransaction(globalTx);

      if (transaction == null) {
         if (unlock) {
            if (log.isTraceEnabled()) {
               log.trace("Unlock for in-existing transaction: " + globalTx + ". Not doing anything.");
            }
            return null;
         }
         //create a remote tx without any modifications (we do not know modifications ahead of time)
         transaction = txTable.createRemoteTransaction(globalTx);
      }
      ctxt.setRemoteTransaction(transaction);
      return invoker.invoke(ctxt, this);
   }
View Full Code Here

Examples of org.infinispan.context.impl.RemoteTxInvocationContext

            PrepareCommand command = (PrepareCommand) object;

            if (!transactionLog.hasPendingPrepare(command)) {
               if (trace) log.trace("Applying pending prepare {0}", command);
               commandsFactory.initializeReplicableCommand(command, false);
               RemoteTxInvocationContext ctx = invocationContextContainer.createRemoteTxInvocationContext();
               RemoteTransaction transaction = txTable.createRemoteTransaction(command.getGlobalTransaction(), command.getModifications());
               ctx.setRemoteTransaction(transaction);
               ctx.setFlags(CACHE_MODE_LOCAL, Flag.SKIP_CACHE_STATUS_CHECK);
               interceptorChain.invoke(ctx, command);
            } else {
               if (trace) log.trace("Prepare {0} not in tx log; not applying", command);
            }
            object = marshaller.objectFromObjectStream(oi);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.