Package org.infinispan.client.hotrod.impl

Examples of org.infinispan.client.hotrod.impl.ConfigurationProperties


   /**
    * Build a cache manager based on supplied properties.
    */
   public RemoteCacheManager(Properties props, boolean start, ClassLoader classLoader, ExecutorFactory asyncExecutorFactory) {
      this.config = new ConfigurationProperties(props);
      this.classLoader = classLoader;
      forceReturnValueDefault = config.getForceReturnValues();
      if (asyncExecutorFactory != null) this.asyncExecutorService = asyncExecutorFactory.getExecutor(props);
      if (start) start();
   }
View Full Code Here


   public RemoteCacheManager(boolean start) {
    this.classLoader = Thread.currentThread().getContextClassLoader();
      InputStream stream = FileLookupFactory.newInstance().lookupFile(HOTROD_CLIENT_PROPERTIES, classLoader);
      if (stream == null) {
         log.couldNotFindPropertiesFile(HOTROD_CLIENT_PROPERTIES);
         config = new ConfigurationProperties();
      } else {
         try {
            loadFromStream(stream);
         } finally {
            Util.close(stream);
View Full Code Here

    * Creates a remote cache manager aware of the Hot Rod server listening at host:port.
    *
    * @param start weather or not to start the RemoteCacheManager.
    */
   public RemoteCacheManager(String host, int port, boolean start, ClassLoader classLoader) {
      config = new ConfigurationProperties(host + ":" + port);
      this.classLoader = classLoader;
      if (start) start();
   }
View Full Code Here

   /**
    * The given string should have the following structure: "host1:port2;host:port2...". Every host:port defines a
    * server.
    */
   public RemoteCacheManager(String servers, boolean start, ClassLoader classLoader) {
      config = new ConfigurationProperties(servers);
      this.classLoader = classLoader;
      if (start) start();
   }
View Full Code Here

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

   public void testPropertyCorrectlyRead() {
      Properties propos = new Properties();
      String value = "org.infinispan.client.hotrod.impl.consistenthash.SomeCustomConsitentHashV1";
      propos.put(ConfigurationProperties.HASH_FUNCTION_PREFIX + ".1", value);
      ConsistentHashFactory chf = new ConsistentHashFactory();
      chf.init(new ConfigurationProperties(propos), Thread.currentThread().getContextClassLoader());
      String s = chf.getVersion2ConsistentHash().get(1);
      assert s != null;
      assert value.equals(s);
   }
View Full Code Here

   public static final String THREAD_NAME = "HotRod-client-async-pool";
   public static final AtomicInteger counter = new AtomicInteger(0);

   @Override
   public ExecutorService getExecutor(Properties p) {
      ConfigurationProperties cp = new ConfigurationProperties(p);
      ThreadFactory tf = new ThreadFactory() {
         public Thread newThread(Runnable r) {
            Thread th = new Thread(r, THREAD_NAME + "-" + counter.getAndIncrement());
            th.setDaemon(true);
            return th;
         }
      };

      return new ThreadPoolExecutor(cp.getDefaultExecutorFactoryPoolSize(), cp.getDefaultExecutorFactoryPoolSize(),
                                    0L, TimeUnit.MILLISECONDS,
                                    new LinkedBlockingQueue<Runnable>(cp.getDefaultExecutorFactoryQueueSize()),
                                    tf);
   }
View Full Code Here

  
   /**
    * Build a cache manager based on supplied properties.
    */
   public RemoteCacheManager(Properties props, boolean start, ClassLoader classLoader, ExecutorFactory asyncExecutorFactory) {
      this.config = new ConfigurationProperties(props);
      this.classLoader = classLoader;
      if (asyncExecutorFactory != null) this.asyncExecutorService = asyncExecutorFactory.getExecutor(props);
      if (start) start();
   }
View Full Code Here

   public RemoteCacheManager(boolean start) {
    this.classLoader = Thread.currentThread().getContextClassLoader();
      InputStream stream = FileLookupFactory.newInstance().lookupFile(HOTROD_CLIENT_PROPERTIES, classLoader);
      if (stream == null) {
         log.couldNotFindPropertiesFile(HOTROD_CLIENT_PROPERTIES);
         config = new ConfigurationProperties();
      } else {
         try {
            loadFromStream(stream);
         } finally {
            Util.close(stream);
View Full Code Here

    * Creates a remote cache manager aware of the Hot Rod server listening at host:port.
    *
    * @param start weather or not to start the RemoteCacheManager.
    */
   public RemoteCacheManager(String host, int port, boolean start, ClassLoader classLoader) {
      config = new ConfigurationProperties(host + ":" + port);
      this.classLoader = classLoader;
      if (start) start();
   }
View Full Code Here

TOP

Related Classes of org.infinispan.client.hotrod.impl.ConfigurationProperties

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.