Package org.infinispan.util

Examples of org.infinispan.util.TypedProperties


   private final TypedProperties props;


   public ConfigurationProperties() {
      this.props = new TypedProperties();
   }
View Full Code Here


      this();
      props.setProperty(SERVER_LIST, serverList);
   }

   public ConfigurationProperties(Properties props) {
      this.props = props == null ? new TypedProperties() : TypedProperties.toTypedProperties(props);
   }
View Full Code Here

      return ssl;
   }

   @Override
   public S withProperties(Properties properties) {
      TypedProperties typed = TypedProperties.toTypedProperties(properties);

      if (typed != null) {
         this.host(typed.getProperty(Main.PROP_KEY_HOST(), host, true));
         this.port(typed.getIntProperty(Main.PROP_KEY_PORT(), port, true));
         this.idleTimeout(typed.getIntProperty(Main.PROP_KEY_IDLE_TIMEOUT(), idleTimeout, true));
         this.recvBufSize(typed.getIntProperty(Main.PROP_KEY_RECV_BUF_SIZE(), recvBufSize, true));
         this.sendBufSize(typed.getIntProperty(Main.PROP_KEY_SEND_BUF_SIZE(), sendBufSize, true));
         this.tcpNoDelay(typed.getBooleanProperty(Main.PROP_KEY_TCP_NO_DELAY(), tcpNoDelay, true));
         this.workerThreads(typed.getIntProperty(Main.PROP_KEY_WORKER_THREADS(), workerThreads, true));
      }

      return this.self();
   }
View Full Code Here

public class DefaultExecutorFactory implements ExecutorFactory {
   private final static AtomicInteger counter = new AtomicInteger(0);

   @Override
   public ExecutorService getExecutor(Properties p) {
      TypedProperties tp = TypedProperties.toTypedProperties(p);
      int maxThreads = tp.getIntProperty("maxThreads", 1);
      int queueSize = tp.getIntProperty("queueSize", 100000);
      final int threadPrio = tp.getIntProperty("threadPriority", Thread.MIN_PRIORITY);
      final String threadNamePrefix = tp.getProperty("threadNamePrefix", tp.getProperty("componentName", "Thread"));
      ThreadFactory tf = new ThreadFactory() {
         @Override
         public Thread newThread(Runnable r) {
            Thread th = new Thread(r, threadNamePrefix + "-" + counter.getAndIncrement());
            th.setDaemon(true);
View Full Code Here

      }

      @Override
      public DataContainerConfig addProperty(String key, String value) {
         if (this.properties == null) {
            this.properties= new TypedProperties();
         }
         this.properties.setProperty(key, value);
         return this;
      }
View Full Code Here

   public IndexingConfigurationBuilder read(IndexingConfiguration template) {
      this.enabled = template.enabled();
      this.indexLocalOnly = template.indexLocalOnly();
      this.properties = new Properties();

      TypedProperties templateProperties = template.properties();
      if (templateProperties != null) {
         for (Map.Entry entry : templateProperties.entrySet()) {
            properties.put(entry.getKey(), entry.getValue());
         }
      }

      return this;
View Full Code Here

      }

      @Override
      public IndexingConfig addProperty(String key, String value) {
         if (properties == null) {
            properties = new TypedProperties();
         }
         this.properties.setProperty(key, value);
         return this;
      }
View Full Code Here

public class DefaultScheduledExecutorFactory implements ScheduledExecutorFactory {
   final static AtomicInteger counter = new AtomicInteger(0);

   @Override
   public ScheduledExecutorService getScheduledExecutor(Properties p) {
      TypedProperties tp = new TypedProperties(p);
      final String threadNamePrefix = p.getProperty("threadNamePrefix", p.getProperty("componentName", "Thread"));
      final int threadPrio = tp.getIntProperty("threadPriority", Thread.MIN_PRIORITY);

      return Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
         @Override
         public Thread newThread(Runnable r) {
            Thread th = new Thread(r, "Scheduled-" + threadNamePrefix + "-" + counter.getAndIncrement());
View Full Code Here

      testImmutability("properties");
      // JBCACHE-531: escape all backslash characters
      // replace any "\" that is not preceded by a backslash with "\\"
      properties = XmlConfigHelper.escapeBackslashes(properties);
      ByteArrayInputStream is = new ByteArrayInputStream(properties.trim().getBytes("ISO8859_1"));
      this.properties = new TypedProperties();
      this.properties.load(is);
      is.close();
   }
View Full Code Here

   @Deprecated
   public Properties getProperties() {
      Properties properties = new Properties();
      if (configuration.asyncExecutorFactory().factoryClass() != null) {
         properties.setProperty(ConfigurationProperties.ASYNC_EXECUTOR_FACTORY, configuration.asyncExecutorFactory().factoryClass().getName());
         TypedProperties aefProps = configuration.asyncExecutorFactory().properties();
         for(String key : Arrays.asList(ConfigurationProperties.DEFAULT_EXECUTOR_FACTORY_POOL_SIZE, ConfigurationProperties.DEFAULT_EXECUTOR_FACTORY_QUEUE_SIZE)) {
            if (aefProps.containsKey(key)) {
               properties.setProperty(key, aefProps.getProperty(key));
            }
         }
      }
      properties.setProperty(ConfigurationProperties.REQUEST_BALANCING_STRATEGY, configuration.balancingStrategy().getName());
      properties.setProperty(ConfigurationProperties.CONNECT_TIMEOUT, Integer.toString(configuration.connectionTimeout()));
View Full Code Here

TOP

Related Classes of org.infinispan.util.TypedProperties

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.