Package org.jboss.cache.commands.tx

Examples of org.jboss.cache.commands.tx.PrepareCommand


         {
            Iterator<Class<? extends ReplicableCommand>> it = expectedCommands.iterator();
            while (it.hasNext())
            {
               Class<? extends ReplicableCommand> replicableCommandClass = it.next();
               PrepareCommand prepareCommand = (PrepareCommand) realOne.getSingleModification();
               if (prepareCommand.containsModificationType(replicableCommandClass))
               {
                  it.remove();
                  break;//only remove once
               }
            }
View Full Code Here


      return buildPrepareCommand(gtx, Collections.singletonList(command), rpcManager.getLocalAddress(), onePhaseCommit);
   }

   public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, Address address, boolean onePhaseCommit)
   {
      return new PrepareCommand(gtx, modifications, address, onePhaseCommit);
   }
View Full Code Here

         }
         // --- transactional method calls

         case PrepareCommand.METHOD_ID:
         {
            command = new PrepareCommand();
            break;
         }

         case OptimisticPrepareCommand.METHOD_ID:
         {
View Full Code Here

      {
         case OptimisticPrepareCommand.METHOD_ID:
         case PrepareCommand.METHOD_ID:

            // Prepare method has a list of modifications. We will just take the first one and extract.
            PrepareCommand pc = (PrepareCommand) cmd;
            List<WriteCommand> modifications = pc.getModifications();
            fqn = extractFqn(modifications.get(0));

            // If this is two phase commit, map the FQN to the GTX so
            // we can find it when the commit/rollback comes through
            if (!pc.isOnePhaseCommit()) transactions.put(pc.getGlobalTransaction(), fqn);

            break;

         case RollbackCommand.METHOD_ID:
         case CommitCommand.METHOD_ID:
View Full Code Here

         if (trace)
            log.trace("Retrieving/Applying pending prepares");
         Object object = cache.getMarshaller().objectFromObjectStream(ois);
         while (object instanceof PrepareCommand)
         {
            PrepareCommand command = (PrepareCommand)object;
            if (! txLog.hasPendingPrepare(command))
            {
               InvocationContext ctx = container.get();
               ctx.setOriginLocal(false);
               ctx.getOptionOverrides().setCacheModeLocal(true);
View Full Code Here

      pendingPrepares.put(command.getGlobalTransaction(), command);
   }

   public void logCommit(GlobalTransaction gtx)
   {
      PrepareCommand command = pendingPrepares.remove(gtx);
      // it is perfectly normal for a prepare not to be logged for this gtx, for example if a transaction did not
      // modify anything, then beforeCompletion() is not invoked and logPrepare() will not be called to register the
      // prepare.
      if (command != null && isActive()) addEntry(gtx, command.getModifications());
   }
View Full Code Here

    */
   @SuppressWarnings("deprecation")
   public Object runPreparePhase(InvocationContext ctx, GlobalTransaction gtx, List<WriteCommand> modifications) throws Throwable
   {
      // running a 2-phase commit.
      PrepareCommand prepareCommand = buildPrepareCommand(gtx, modifications, false);

      transactionLog.logPrepare(prepareCommand);

      Object result;

View Full Code Here

   {
      Object retVal = invokeNextInterceptor(ctx, command);
      TransactionEntry te = ctx.getTransactionEntry();
      if (te.hasLocalModifications())
      {
         PrepareCommand replicablePrepareCommand = command.clone(); // makre sure we remove any "local" transactions
         replicablePrepareCommand.removeModifications(te.getLocalModifications());
         command = replicablePrepareCommand;
      }

      if (!skipReplicationOfTransactionMethod(ctx)) runPreparePhase(command, command.getGlobalTransaction(), ctx);
      return retVal;
View Full Code Here

      return buildPrepareCommand(gtx, Collections.singletonList(command), rpcManager.getLocalAddress(), onePhaseCommit);
   }

   public PrepareCommand buildPrepareCommand(GlobalTransaction gtx, List<ReversibleCommand> modifications, Address address, boolean onePhaseCommit)
   {
      return new PrepareCommand(gtx, modifications, address, onePhaseCommit);
   }
View Full Code Here

         }
         // --- transactional method calls

         case PrepareCommand.METHOD_ID:
         {
            command = new PrepareCommand();
            break;
         }

         case OptimisticPrepareCommand.METHOD_ID:
         {
View Full Code Here

TOP

Related Classes of org.jboss.cache.commands.tx.PrepareCommand

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.