Package org.infinispan.commons.util

Examples of org.infinispan.commons.util.TypedProperties


      }

      @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


      }

      @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 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

      return getScheduledExecutor(p, null);
   }

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

         public Thread createThread(Runnable r) {
            Thread th = new Thread(r, "Scheduled-" + threadNamePrefix + "-" + counter.getAndIncrement());
View Full Code Here

      return getExecutor(p, null);
   }

   @Override
   public ExecutorService getExecutor(Properties p, final AccessControlContext context) {
      TypedProperties tp = TypedProperties.toTypedProperties(p);
      int maxThreads = tp.getIntProperty("maxThreads", 1);
      int queueSize = tp.getIntProperty("queueSize", 100000);
      int coreThreads = queueSize == 0 ? 1 : tp.getIntProperty("coreThreads", maxThreads);
      long keepAliveTime = tp.getLongProperty("keepAliveTime", 60000);
      final int threadPrio = tp.getIntProperty("threadPriority", Thread.MIN_PRIORITY);
      final String threadNamePrefix = tp.getProperty("threadNamePrefix", tp.getProperty("componentName", "Thread"));
      final String threadNameSuffix = tp.getProperty("threadNameSuffix", "");
      BlockingQueue<Runnable> queue = queueSize == 0 ? new SynchronousQueue<Runnable>()
            : new LinkedBlockingQueue<Runnable>(queueSize);
      ThreadFactory tf = new ThreadFactory() {

         private Thread createThread(Runnable r) {
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

public class DefaultExecutorFactory implements ExecutorFactory {
   private final 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);
      int coreThreads = queueSize == 0 ? 1 : tp.getIntProperty("coreThreads", maxThreads);
      long keepAliveTime = tp.getLongProperty("keepAliveTime", 60000);
      final int threadPrio = tp.getIntProperty("threadPriority", Thread.MIN_PRIORITY);
      final String threadNamePrefix = tp.getProperty("threadNamePrefix", tp.getProperty("componentName", "Thread"));
      final String threadNameSuffix = tp.getProperty("threadNameSuffix", "");
      BlockingQueue<Runnable> queue = queueSize == 0 ? new SynchronousQueue<Runnable>() :
            new LinkedBlockingQueue<Runnable>(queueSize);
      ThreadFactory tf = new ThreadFactory() {
         @Override
         public Thread newThread(Runnable r) {
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

      }

      @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

TOP

Related Classes of org.infinispan.commons.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.