Package org.jboss.cache.commands

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


   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

   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

      List<ReplicableCommand> calls = new ArrayList<ReplicableCommand>();

      Fqn f = Fqn.fromElements("BlahBlah", 3, false);
      String k = "key", v = "value";

      ReplicableCommand cmd = new PutKeyValueCommand(null, f, k, v);
      ReplicableCommand replCmd = new ReplicateCommand(cmd);

      calls.add(replCmd);

      cmd = new PutKeyValueCommand(null, f, k, v);
      replCmd = new ReplicateCommand(cmd);

      calls.add(replCmd);

      ReplicableCommand replAllCmd = new ReplicateCommand(calls);

      byte[] buf = marshaller.objectToByteBuffer(replAllCmd);

      assertEquals(replAllCmd, marshaller.objectFromByteBuffer(buf));
   }
View Full Code Here

   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

      {
         Class<? extends ReplicableCommand> commadType = typeIt.next();
         Iterator<ReplicableCommand> instanceIt = mods.iterator();
         while (instanceIt.hasNext())
         {
            ReplicableCommand replicableCommand = instanceIt.next();
            if (replicableCommand.getClass().equals(commadType))
            {
               instanceIt.remove();
               typeIt.remove();
            }
         }
View Full Code Here

   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

   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

      List<ReplicableCommand> calls = new ArrayList<ReplicableCommand>();

      Fqn f = Fqn.fromElements("BlahBlah", 3, false);
      String k = "key", v = "value";

      ReplicableCommand cmd = new PutKeyValueCommand(null, f, k, v);
      ReplicableCommand replCmd = new ReplicateCommand(cmd);

      calls.add(replCmd);

      cmd = new PutKeyValueCommand(null, f, k, v);
      replCmd = new ReplicateCommand(cmd);

      calls.add(replCmd);

      ReplicableCommand replAllCmd = new ReplicateCommand(calls);

      byte[] buf = marshaller.objectToByteBuffer(replAllCmd);

      assertEquals(replAllCmd, marshaller.objectFromByteBuffer(buf));
   }
View Full Code Here

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

TOP

Related Classes of org.jboss.cache.commands.ReplicableCommand

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.