Examples of GlobalTransaction


Examples of org.infinispan.transaction.GlobalTransaction

      Object retval = invokeNextInterceptor(ctx, command);
      Transaction tx = ctx.getTransaction();
      if (tx != null) {
         if (trace) log.trace("Entering InvalidationInterceptor's prepare phase");
         // fetch the modifications before the transaction is committed (and thus removed from the txTable)
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         TransactionContext transactionContext = ctx.getTransactionContext();
         if (transactionContext == null)
            throw new IllegalStateException("cannot find transaction transactionContext for " + gtx);

         if (transactionContext.hasModifications()) {
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

            return retVal;
         case MAGICNUMBER_JG_ADDRESS:
            retVal = unmarshallJGroupsAddress(in);
            return retVal;
         case MAGICNUMBER_TRANSACTION_LOG:
            GlobalTransaction gtx = (GlobalTransaction) unmarshallObject(in, refMap);
            int numCommands = readUnsignedInt(in);
            WriteCommand[] cmds = new WriteCommand[numCommands];
            for (int i = 0; i < numCommands; i++) cmds[i] = (WriteCommand) unmarshallObject(in, refMap);
            return new TransactionLog.LogEntry(gtx, cmds);
         case MAGICNUMBER_CACHESTORE_BUCKET:
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

      return remoteCommandFactory.fromStream((byte) methodId, args);
   }


   private GlobalTransaction unmarshallGlobalTransaction(ObjectInput in, UnmarshalledReferences refMap) throws IOException, ClassNotFoundException {
      GlobalTransaction gtx = new GlobalTransaction();
      long id = in.readLong();
      Object address = unmarshallObject(in, refMap);
      gtx.setId(id);
      gtx.setAddress((Address) address);
      return gtx;
   }
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

         output.writeObject(c);
   }

   public Object createExternal(Class<?> subjectType, ObjectInput input, Creator defaultCreator)
         throws IOException, ClassNotFoundException {
      GlobalTransaction gtx = (GlobalTransaction) input.readObject();
      int numCommands = MarshallUtil.readUnsignedInt(input);
      WriteCommand[] cmds = new WriteCommand[numCommands];
      for (int i = 0; i < numCommands; i++) cmds[i] = (WriteCommand) input.readObject();
      return new TransactionLog.LogEntry(gtx, cmds);
   }
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

    * The serialVersionUID
    */
   private static final long serialVersionUID = -8677909497367726531L;

   public void writeExternal(Object subject, ObjectOutput output) throws IOException {
      GlobalTransaction gtx = (GlobalTransaction) subject;
      output.writeLong(gtx.getId());
      output.writeObject(gtx.getAddress());
   }
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

      output.writeObject(gtx.getAddress());
   }

   public Object createExternal(Class<?> subjectType, ObjectInput input, Creator defaultCreator)
         throws IOException, ClassNotFoundException {
      return new GlobalTransaction();
   }
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

      return new GlobalTransaction();
   }

   public void readExternal(Object subject, ObjectInput input) throws IOException,
                                                                      ClassNotFoundException {
      GlobalTransaction gtx = (GlobalTransaction) subject;
      long id = input.readLong();
      Object address = input.readObject();
      gtx.setId(id);
      gtx.setAddress((Address) address);
   }
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

         @Override
         public ClusteredGetCommand answer(InvocationOnMock invocation) {
            Object key = invocation.getArguments()[0];
            Set<Flag> flags = (Set<Flag>) invocation.getArguments()[1];
            boolean acquireRemoteLock = (Boolean) invocation.getArguments()[2];
            GlobalTransaction gtx = (GlobalTransaction) invocation.getArguments()[3];
            return new ClusteredGetCommand(key, "cache1", flags, acquireRemoteLock, gtx);
         }
      });

      EntryFactory entryFactory = mock(EntryFactory.class);
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

      }
   }

   private void setTx(InvocationContext ctx, EventImpl<Object, Object> e) {
      if (ctx != null && ctx.isInTxScope()) {
         GlobalTransaction tx = ((TxInvocationContext) ctx).getGlobalTransaction();
         e.setTransactionId(tx);
      }
   }
View Full Code Here

Examples of org.infinispan.transaction.xa.GlobalTransaction

         localTransaction.clearRemoteLocksAcquired();
         return completeTransaction(localTransaction, commit, xid);
      } else {
         RecoveryAwareRemoteTransaction tx = getPreparedTransaction(xid);
         if (tx == null) return "Could not find transaction " + xid;
         GlobalTransaction globalTransaction = tx.getGlobalTransaction();
         globalTransaction.setAddress(rpcManager.getAddress());
         globalTransaction.setRemote(false);
         RecoveryAwareLocalTransaction localTx = (RecoveryAwareLocalTransaction) txFactory.newLocalTransaction(null, globalTransaction, false, tx.getTopologyId());
         localTx.setModifications(tx.getModifications());
         localTx.setXid(xid);
         localTx.addAllAffectedKeys(tx.getAffectedKeys());
         for (Object lk : tx.getLockedKeys()) localTx.registerLockedKey(lk);
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.