Examples of ReplicableCommand


Examples of org.jboss.cache.commands.ReplicableCommand

            callRecipients = usingBuddyReplication && !isBroadcast ? buddyManager.getBuddyAddressesAsVector() : null;
            if (trace)
               log.trace("Setting call recipients to " + callRecipients + " since the original list of recipients passed in is null.");
         }

         ReplicableCommand toCall = wrapCacheCommandInReplicateMethod ? commandsFactory.buildReplicateCommand(call) : call;

         List rsps = rpcManager.callRemoteMethods(callRecipients,
               toCall,
               sync, // is synchronised?
               timeout,
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

         DataVersionPopulator populator = new DataVersionPopulator(getTransactionWorkspace(ctx), command.getModifications().size());

         // visit all elements in the collection and apply the DataVersionPopulator to ensure all commands have data versions set.
         populator.visitCollection(null, command.getModifications());

         ReplicableCommand toBroadcast = commandsFactory.buildOptimisticPrepareCommand(gtx, populator.versionedCommands, command.getLocalAddress(), command.isOnePhaseCommit());

         //record the things we have possibly sent
         broadcastTxs.add(gtx);
         if (log.isDebugEnabled())
         {
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

      }

      rman.activate(A);
      assertTrue(rman.hasRegion(A, Region.Type.MARSHALLING));

      ReplicableCommand result = (ReplicableCommand) testee.objectFromByteBuffer(callBytes);
      assertEquals("Did not get replicate method when passing" +
            " call for active node", ReplicateCommand.class, result.getClass());
   }
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

            region = rrv.region;
            o = rrv.returnValue;
         }
         else if (o instanceof ReplicableCommand)
         {
            ReplicableCommand marshallableCommand = (ReplicableCommand) o;
            region = extractFqnRegion(marshallableCommand);
         }

         if (trace) log.trace("Region based call.  Using region " + region);
         objectToObjectStream(o, out, region);
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

         out.writeByte(MAGICNUMBER_REF);
         writeReference(out, refMap.get(o));
      }
      else if (o instanceof ReplicableCommand)
      {
         ReplicableCommand command = (ReplicableCommand) o;

         if (command.getCommandId() > -1)
         {
            out.writeByte(MAGICNUMBER_METHODCALL);
            marshallCommand(command, out, refMap);
         }
         else
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

   public Object handle(Message req)
   {
      if (isValid(req))
      {
         RegionalizedMethodCall rmc;
         ReplicableCommand command;

         try
         {
            // we will ALWAYS be using the marshaller to unmarshall requests.
            rmc = requestMarshaller.regionalizedMethodCallFromByteBuffer(req.getBuffer());
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

      void logCall(ReplicableCommand command, boolean oob)
      {
         if (command instanceof ReplicateCommand)
         {
            ReplicableCommand cmd = ((ReplicateCommand) command).getSingleModification();
            log.put(cmd.getClass(), oob);
         }
      }
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

   public void testRootFqnManipulation()
   {
      Fqn fqn1 = Fqn.ROOT;

      ReplicableCommand call1 = new PutKeyValueCommand(null, fqn1, "key", "value");
      ReplicateCommand call2 = new ReplicateCommand(call1);

      BuddyManager bm = createBasicBuddyManager();

      ReplicateCommand newReplicatedCall = bm.transformReplicateCommand(call2);
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

   public void testMethodCall() throws Exception
   {
      CacheMarshallerTestBaseTL tl = threadLocal.get();
      VersionAwareMarshaller marshaller = tl.marshaller;
      Fqn fqn = Fqn.fromElements(3, false);
      ReplicableCommand cmd = new PutKeyValueCommand(null, fqn, "key", "value");
      byte[] asBytes = marshaller.objectToByteBuffer(cmd);
      Object o2 = marshaller.objectFromByteBuffer(asBytes);

      assertTrue("Unmarshalled object should be a method call", o2 instanceof ReplicableCommand);
      ReplicableCommand cmd2 = (ReplicableCommand) o2;

      assertEquals(cmd, cmd2);
   }
View Full Code Here

Examples of org.jboss.cache.commands.ReplicableCommand

   public void testNestedMethodCall() throws Exception
   {
      CacheMarshallerTestBaseTL tl = threadLocal.get();
      VersionAwareMarshaller marshaller = tl.marshaller;
      Fqn fqn = Fqn.fromElements(3, false);
      ReplicableCommand cmd = new PutKeyValueCommand(null, fqn, "key", "value");
      ReplicableCommand replicateCmd = new ReplicateCommand(cmd);
      byte[] asBytes = marshaller.objectToByteBuffer(replicateCmd);
      Object o2 = marshaller.objectFromByteBuffer(asBytes);
      assertTrue("Unmarshalled object should be a method call", o2 instanceof ReplicableCommand);
      ReplicableCommand cmd2 = (ReplicableCommand) o2;

      assertEquals(replicateCmd, cmd2);
   }
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.