Package org.infinispan.client.hotrod.impl.transport

Examples of org.infinispan.client.hotrod.impl.transport.Transport


   /**
    * Request: [header][key length][key][entry_version]
    */
   public VersionedOperationResponse removeIfUnmodified(byte[] key, long version, Flag... flags) {
      Transport transport = transportFactory.getTransport(key);
      try {
         // 1) write header
         long messageId = writeHeader(transport, REMOVE_IF_UNMODIFIED_REQUEST, flags);

         //2) write message body
         transport.writeArray(key);
         transport.writeLong(version);

         //process response and return
         return returnVersionedOperationResponse(transport, messageId, REMOVE_IF_UNMODIFIED_RESPONSE, flags);

      } finally {
View Full Code Here


         releaseTransport(transport);
      }
   }

   public void clear(Flag... flags) {
      Transport transport = transportFactory.getTransport();
      try {
         // 1) write header
         long messageId = writeHeader(transport, CLEAR_REQUEST, flags);
         readHeaderAndValidate(transport, messageId, CLEAR_RESPONSE);
      } finally {
View Full Code Here

         releaseTransport(transport);
      }
   }

   public Map<String, String> stats() {
      Transport transport = transportFactory.getTransport();
      try {
         // 1) write header
         long messageId = writeHeader(transport, STATS_REQUEST);
         readHeaderAndValidate(transport, messageId, STATS_RESPONSE);
         int nrOfStats = transport.readVInt();

         Map<String, String> result = new HashMap<String, String>();
         for (int i = 0; i < nrOfStats; i++) {
            String statName = transport.readString();
            String statValue = transport.readString();
            result.put(statName, statValue);
         }
         return result;
      } finally {
         releaseTransport(transport);
View Full Code Here

      }
   }

   @Override
   public boolean ping() {
      Transport transport = null;
      try {
         transport = transportFactory.getTransport();
         // 1) write header
         long messageId = writeHeader(transport, PING_REQUEST);
         short respStatus = readHeaderAndValidate(transport, messageId, HotrodConstants.PING_RESPONSE);
View Full Code Here

   private <K, V> PingResult ping(RemoteCacheImpl<K, V> cache) {
      if (transportFactory == null) {
         return PingResult.FAIL;
      }

      Transport transport = transportFactory.getTransport();
      try {
         return cache.ping(transport);
      } finally {
        transportFactory.releaseTransport(transport);
      }
View Full Code Here

   @Override
   public Object execute() {
      int retryCount = 0;
      while (shouldRetry(retryCount)) {
         Transport transport = getTransport(retryCount);
         try {
            return executeOperation(transport);
         } catch (TransportException te) {
            logErrorAndThrowExceptionIfNeeded(retryCount, te);
         } catch (RemoteNodeSuspecException e) {
View Full Code Here

   private <K, V> PingResult ping(RemoteCacheImpl<K, V> cache) {
      if (transportFactory == null) {
         return PingResult.FAIL;
      }

      Transport transport = transportFactory.getTransport();
      try {
         return cache.ping(transport);
      } finally {
        transportFactory.releaseTransport(transport);
      }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.impl.transport.Transport

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.