Package org.infinispan.transaction

Examples of org.infinispan.transaction.GlobalTransaction


   private Object handleAlterCacheMethod(InvocationContext ctx, WriteCommand command)
         throws Throwable {
      Object result = invokeCommand(ctx, command);
      if (ctx.isValidTransaction()) {
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         if (gtx == null) {
            if (log.isDebugEnabled()) {
               log.debug("didn't find GlobalTransaction for " + ctx.getTransaction() + "; won't add modification to transaction list");
            }
         } else {
View Full Code Here


            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_ARRAY:
View Full Code Here

      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

         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

    * 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

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

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

      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

   /**
    * @return a GlobalTransaction instance if the current call is participating in a transaction, or the current thread
    *         otherwise.
    */
   protected final Object currentRequestor() {
      GlobalTransaction gtx;
      return (gtx = invocationContextContainer.get().getGlobalTransaction()) == null ? Thread.currentThread() : gtx;
   }
View Full Code Here

         if (trace) log.trace("received my own message (discarding it)");
         return null;
      }
      try {
         if (trace) log.trace("(" + cacheManager.getAddress() + ") call on command [" + command + "]");
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         Transaction ltx = txTable.getLocalTransaction(gtx, true);
         // disconnect if we have a current tx associated
         Transaction currentTx = txManager.getTransaction();
         boolean resumeCurrentTxOnCompletion = false;
         try {
View Full Code Here

         if (trace) log.trace("received my own message (discarding it)");
         return null;
      }
      try {
         if (trace) log.trace("(" + cacheManager.getAddress() + ") call on command [" + command + "]");
         GlobalTransaction gtx = ctx.getGlobalTransaction();
         Transaction ltx = txTable.getLocalTransaction(gtx);
         if (ltx == null) {
            log.warn("No local transaction for this remotely originating rollback.  Possibly rolling back before a prepare call was broadcast?");
            txTable.cleanup(gtx);
            return null;
View Full Code Here

TOP

Related Classes of org.infinispan.transaction.GlobalTransaction

Copyright © 2018 www.massapicom. 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.