Examples of CustomizableThreadFactory


Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

    private ScheduledExecutorService createCleanUpExecutor() {

        final int numCleaningThreads = quotaConfig.getMaxConcurrentCleanUps();
        log.info("Setting up disk quota periodic enforcement task");
        CustomizableThreadFactory tf = new CustomizableThreadFactory(
                "GWC DiskQuota clean up thread-");
        tf.setThreadPriority(1 + (Thread.MAX_PRIORITY - Thread.MIN_PRIORITY) / 5);

        ScheduledExecutorService executorService = Executors.newScheduledThreadPool(
                numCleaningThreads, tf);

        return executorService;
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

            return;
        }
        open = true;
        File storeDirectory = new File(cacheRootDir, "diskquota_page_store");
        storeDirectory.mkdirs();
        CustomizableThreadFactory tf = new CustomizableThreadFactory("GWC DiskQuota Store Writer-");
        transactionRunner = Executors.newFixedThreadPool(1, tf);
        try {
            configure(storeDirectory);

            deleteStaleLayersAndCreateMissingTileSets();
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

        FileBlobStore.deleteExecutorService.submit(new DefferredDirectoryDeleteTask(
                pendingDeleteDirectory));
    }

    private void createDeleteExecutorService() {
        CustomizableThreadFactory tf;
        tf = new CustomizableThreadFactory("GWC FileStore delete directory thread-");
        tf.setDaemon(true);
        tf.setThreadPriority(Thread.MIN_PRIORITY);
        deleteExecutorService = Executors.newFixedThreadPool(1);
    }
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

        return "jms";
    }

    // Initialise the thread pool to have the requested number of threads available, life span of threads (set to 0) not used as threads will never be eligible to die as coreSize = maxSize
    public void initThreadPool() {
        CustomizableThreadFactory ctf = new CustomizableThreadFactory();
        ctf.setDaemon(true);
        ctf.setThreadNamePrefix(getTransportName()+"-Publisher-");
        threadPool = new JMXReportingThreadPoolExecutor(threadPoolSize, threadPoolSize, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), ctf);
    }
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

        if (TimeUnit.SECONDS.toMillis(this.timeout) >= this.registry.getTimeToKeepAfterAccessInMillis()) {
            final String msg = String.format("%s timeout must be smaller than %s timeToKeepAfterAccess",
                    getClass().getName(), this.registry.getClass().getName());
            throw new IllegalStateException(msg);
        }
        CustomizableThreadFactory threadFactory = new CustomizableThreadFactory();
        threadFactory.setDaemon(true);
        threadFactory.setThreadNamePrefix("PrintJobManager-");

        this.queue = new PriorityBlockingQueue<Runnable>(this.maxNumberOfWaitingJobs, new Comparator<Runnable>() {
            @Override
            public int compare(final Runnable o1, final Runnable o2) {
                if (o1 instanceof PrintJob) {
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

      } catch (Throwable t) {
        log.error("Exception when handling pipe connection event", t);
      }
    }
    if (taskExecutor == null) {
      taskExecutor = Executors.newCachedThreadPool(new CustomizableThreadFactory("Pipe-"));
    }
    // Run all of event's tasks
    for (Runnable task : event.getTaskList()) {
      try {
        taskExecutor.execute(task);
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

  /**
   * Default ctor
   */
  public FileConsumer() {
    if (scheduledExecutorService == null) {
      scheduledExecutorService = Executors.newScheduledThreadPool(schedulerThreadSize, new CustomizableThreadFactory("FileConsumerExecutor-"));
    }
  }
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

       * a thread number in the pool as in "Thread[vcService{2}-1]".
       * @throws Exception
       */
      private void initVmomiClient() throws URISyntaxException {
         String threadNamePrefix = serviceName + "{" + genCount + "}-";
         CustomizableThreadFactory threadFactory = new CustomizableThreadFactory(threadNamePrefix);
         threadFactory.setDaemon(true);
         if (useExecutor) {
            executor = new MyThreadPoolExecutor(1, 1, 10, TimeUnit.SECONDS,
                              new MyBlockingQueue<Runnable>(), threadFactory);
         } else {
            executor = null;
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

      }
    }

    this.logs = new StringBuffer();
    final String[] finalEnvironmentTokens = environmentTokens;
    ExecutorService executorService = Executors.newFixedThreadPool(1, new CustomizableThreadFactory("shell-"));
    Future f = executorService.submit(new Runnable() {
      public void run() {
        try {
           Runtime rt = Runtime.getRuntime();
           Process pr = rt.exec(commandTokens, finalEnvironmentTokens);
View Full Code Here

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory

  @ManagedOperation
  public void shutDown() throws Exception {

    stop();

    ExecutorService executorService = Executors.newFixedThreadPool(1, new CustomizableThreadFactory("shell-"));
    executorService.submit(new Runnable() {
      public void run() {
        try {
          try {
            Thread.sleep(5000);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.