Package org.jboss.cache.commands.read

Examples of org.jboss.cache.commands.read.GetKeyValueCommand


   @SuppressWarnings("unchecked")
   public V get(Fqn fqn, K key)
   {
      InvocationContext ctx = invocationContextContainer.get();
      cacheStatusCheck(ctx);
      GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(fqn, key, true);
      return (V) invoker.invoke(ctx, command);
   }
View Full Code Here


      try
      {
         NodeSPI n = cache.peek(name, false);
         if (n == null)
         {
            GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(name, key, true);
            return callRemote(command);
         }
         else
         {
            // dont bother with a remote call
View Full Code Here

      try
      {
         NodeSPI n = cache.peek(name, true);
         if (n == null)
         {
            GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(name, key, true);
            return callRemote(command);
         }
         else
         {
            // dont bother with a remote call
View Full Code Here

      return command;
   }

   public GetKeyValueCommand buildGetKeyValueCommand(Fqn fqn, Object key, boolean sendNodeEvent)
   {
      GetKeyValueCommand command = new GetKeyValueCommand(fqn, key, sendNodeEvent);
      command.initialize(dataContainer, notifier);
      return command;
   }
View Full Code Here

            command = returnValue;
            break;
         }
         case GetKeyValueCommand.METHOD_ID:
         {
            GetKeyValueCommand returnValue = new GetKeyValueCommand();
            returnValue.initialize(dataContainer, notifier);
            command = returnValue;
            break;
         }
         case GetNodeCommand.METHOD_ID:
         {
            GetNodeCommand returnValue = new GetNodeCommand();
            returnValue.initialize(dataContainer);
            command = returnValue;
            break;
         }
         case MoveCommand.METHOD_ID:
         {
            MoveCommand returnValue = new MoveCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }
         case PutDataMapCommand.METHOD_ID:
         case PutDataMapCommand.ERASE_METHOD_ID:
         case PutDataMapCommand.ERASE_VERSIONED_METHOD_ID:
         case PutDataMapCommand.VERSIONED_METHOD_ID:
         {
            PutDataMapCommand returnValue = new PutDataMapCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }
         case PutKeyValueCommand.METHOD_ID:
         case PutKeyValueCommand.VERSIONED_METHOD_ID:
         {
            PutKeyValueCommand returnValue = new PutKeyValueCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }
         case PutForExternalReadCommand.METHOD_ID:
         case PutForExternalReadCommand.VERSIONED_METHOD_ID:
         {
            PutForExternalReadCommand returnValue = new PutForExternalReadCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }
         case ClearDataCommand.METHOD_ID:
         case ClearDataCommand.VERSIONED_METHOD_ID:
         {
            ClearDataCommand returnValue = new ClearDataCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }
         case RemoveKeyCommand.METHOD_ID:
         case RemoveKeyCommand.VERSIONED_METHOD_ID:
         {
            RemoveKeyCommand returnValue = new RemoveKeyCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }

         case RemoveNodeCommand.METHOD_ID:
         case RemoveNodeCommand.VERSIONED_METHOD_ID:
         {
            RemoveNodeCommand returnValue = new RemoveNodeCommand();
            returnValue.initialize(notifier, dataContainer);
            command = returnValue;
            break;
         }
         case CreateNodeCommand.METHOD_ID:
         {
            throw new UnsupportedOperationException("CreateNodeCommand is not supported in MVCC!");
         }
         // --- transactional method calls

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

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

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

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

         // --- replicate methods
         case ReplicateCommand.MULTIPLE_METHOD_ID:
         case ReplicateCommand.SINGLE_METHOD_ID:
         {
            ReplicateCommand returnValue = new ReplicateCommand();
            returnValue.initialize(invoker);
            command = returnValue;
            break;
         }

         case InvalidateCommand.METHOD_ID:
         {
            InvalidateCommand returnValue = new InvalidateCommand();
            returnValue.initialize(cacheSpi, dataContainer, notifier);
            command = returnValue;
            break;
         }

         case ClusteredGetCommand.METHOD_ID:
         {
            ClusteredGetCommand returnValue = new ClusteredGetCommand();
            returnValue.initialize(dataContainer, invoker);
            command = returnValue;
            break;
         }
         // ---- Buddy replication - group organisation commands
         case AnnounceBuddyPoolNameCommand.METHOD_ID:
         {
            AnnounceBuddyPoolNameCommand returnValue = new AnnounceBuddyPoolNameCommand();
            returnValue.initialize(buddyManager);
            command = returnValue;
            break;
         }
         case AssignToBuddyGroupCommand.METHOD_ID:
         {
            AssignToBuddyGroupCommand returnValue = new AssignToBuddyGroupCommand();
            returnValue.initialize(buddyManager);
            command = returnValue;
            break;
         }
         case RemoveFromBuddyGroupCommand.METHOD_ID:
         {
            RemoveFromBuddyGroupCommand returnValue = new RemoveFromBuddyGroupCommand();
            returnValue.initialize(buddyManager);
            command = returnValue;
            break;
         }
         case DataGravitationCleanupCommand.METHOD_ID:
         {
            DataGravitationCleanupCommand returnValue = new DataGravitationCleanupCommand();
            returnValue.initialize(buddyManager, invoker, transactionTable, this, dataContainer, buddyFqnTransformer);
            command = returnValue;
            break;
         }
         case GravitateDataCommand.METHOD_ID:
         {
            GravitateDataCommand returnValue = new GravitateDataCommand(rpcManager.getLocalAddress());
            returnValue.initialize(dataContainer, cacheSpi, buddyFqnTransformer);
            command = returnValue;
            break;
         }
         default:
            throw new CacheException("Unknown command id " + id + "!");
View Full Code Here

   @SuppressWarnings("unchecked")
   public V get(Fqn fqn, K key)
   {
      InvocationContext ctx = invocationContextContainer.get();
      cacheStatusCheck(ctx);
      GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(fqn, key, true);
      return (V) invoker.invoke(ctx, command);
   }
View Full Code Here

      assertNotNull(cache2.get(fqn, key));
      assertNotSame(MyList.class, cache2.get(fqn, key).getClass());
      assertSame(listClass, cache2.get(fqn, key).getClass());


      DataCommand command = new GetKeyValueCommand(fqn, key, false);
      ClusteredGetCommand clusteredGet = new ClusteredGetCommand(false, command);

      List responses = cache1.getRPCManager().callRemoteMethods(null, clusteredGet, true, 15000, false);
      List response1 = (List) responses.get(0);// response from the first (and only) node
View Full Code Here

      assertNotNull(cache2.get(fqn, key));
      assertNotSame(MyList.class, cache2.get(fqn, key).getClass());
      assertSame(listClass, cache2.get(fqn, key).getClass());


      DataCommand command = new GetKeyValueCommand(fqn, key, false);
      ClusteredGetCommand clusteredGet = new ClusteredGetCommand(false, command);

      List responses = cache1.getRPCManager().callRemoteMethods(null, clusteredGet, true, 15000, false);
      List response1 = (List) responses.get(0);// response from the first (and only) node
View Full Code Here

      try
      {
         NodeSPI n = cache.peek(name, false);
         if (n == null)
         {
            GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(name, key, true);
            return callRemote(command);
         }
         else
         {
            // dont bother with a remote call
View Full Code Here

      try
      {
         NodeSPI n = cache.peek(name, true);
         if (n == null)
         {
            GetKeyValueCommand command = commandsFactory.buildGetKeyValueCommand(name, key, true);
            return callRemote(command);
         }
         else
         {
            // dont bother with a remote call
View Full Code Here

TOP

Related Classes of org.jboss.cache.commands.read.GetKeyValueCommand

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.