Package org.infinispan.client.hotrod.exceptions

Examples of org.infinispan.client.hotrod.exceptions.HotRodClientException


   private byte[] obj2bytes(Object o, boolean isKey) {
      try {
         return marshaller.objectToByteBuffer(o, isKey ? estimateKeySize : estimateValueSize);
      } catch (IOException ioe) {
         throw new HotRodClientException(
               "Unable to marshall object of type [" + o.getClass().getName() + "]", ioe);
      } catch (InterruptedException ie) {
         Thread.currentThread().interrupt();
         return null;
      }
View Full Code Here


   private Object bytes2obj(byte[] bytes) {
      if (bytes == null) return null;
      try {
         return marshaller.objectFromByteBuffer(bytes);
      } catch (Exception e) {
         throw new HotRodClientException(
               "Unable to unmarshall byte stream", e);
      }
   }
View Full Code Here

      try {
         MarshallerRegistration.registerMarshallers(serializationContext);
      } catch (Exception e) {
         //todo [anistor] need better exception handling
         throw new HotRodClientException("Failed to initialise serialization context", e);
      }
   }
View Full Code Here

            try {
               byte[] bytes = (byte[]) r.getValue();
               Object o = ProtobufUtil.fromWrappedByteArray(serCtx, bytes);
               results.add(o);
            } catch (IOException e) {
               throw new HotRodClientException(e);
            }
         }
      }

      return results;
View Full Code Here

   @Override
   public byte[] marshallObject(Object toMarshall) {
      try {
         return marshaller.objectToByteBuffer(toMarshall);
      } catch (IOException e) {
         throw new HotRodClientException(e);
      }
   }
View Full Code Here

   @Override
   public Object readObject(byte[] bytes) {
      try {
         return marshaller.objectFromByteBuffer(bytes);
      } catch (Exception e) {
         throw new HotRodClientException(e);
      }
   }
View Full Code Here

            if (status == HotRodConstants.COMMAND_TIMEOUT_STATUS && isTrace) {
               log.trace("Server-side timeout performing operation: %s", msgFromServer);
            } else {
               log.warn("Error received from the server: %s", msgFromServer);
            }
            throw new HotRodClientException(msgFromServer, messageId, status);
         }
         default: {
            throw new IllegalStateException(String.format("Unknown status: %#04x", status));
         }
      }
View Full Code Here

         case HotRodConstants.UNKNOWN_VERSION_STATUS: {
            String msgFromServer = transport.readString();
            if (log.isWarnEnabled()) {
               log.warn("Error status received from the server:" + msgFromServer + " for message id " + messageId);
            }
            throw new HotRodClientException(msgFromServer, messageId, status);
         }
         case HotRodConstants.COMMAND_TIMEOUT_STATUS: {
            String msg = transport.readString();
            if (log.isTraceEnabled()) {
               log.trace("Server-side timeout performing operation: " + msg);
View Full Code Here

    */
   public RemoteCacheManager(URL config, boolean start) {
      try {
         loadFromStream(config.openStream());
      } catch (IOException e) {
         throw new HotRodClientException("Could not read URL:" + config, e);
      }
      if (start)
         start();
   }
View Full Code Here

   private void loadFromStream(InputStream stream) {
      Properties properties = new Properties();
      try {
         properties.load(stream);
      } catch (IOException e) {
         throw new HotRodClientException("Issues configuring from client hotrod-client.properties", e);
      }
      config = new ConfigurationProperties(properties);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.exceptions.HotRodClientException

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.