Package org.springframework.scheduling.concurrent

Examples of org.springframework.scheduling.concurrent.CustomizableThreadFactory


  @ManagedOperation
  public void shutDown() {
    if (applicationContext instanceof ConfigurableApplicationContext) {
      ((ConfigurableApplicationContext)applicationContext).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


      System.exit(-1);
    }

    log.info("Running SpringDataServer");
       
    ExecutorService executorService = Executors.newFixedThreadPool(4, new CustomizableThreadFactory("server-"));
    List<Callable<Void>> tasks = new ArrayList<Callable<Void>>();
    if (options.getAppConfig() != null) {
      tasks.add(createIntegrationCallable(options));
    } else if (options.isBatchAdmin() == true ) {
      tasks.add(createAdminCallable());
View Full Code Here

 
  private String beanName;
 
  public void afterPropertiesSet() throws Exception {
    if(executorService == null && sendMailThreadPoolSize > 0) {
      executorService = Executors.newFixedThreadPool(sendMailThreadPoolSize,new CustomizableThreadFactory(getClass().getSimpleName()+"-"));
      log.info("create send mail executorService,sendMailThreadPoolSize:"+sendMailThreadPoolSize);
    }
   
    Assert.notNull(javaMailSender,"javaMailSender must be not null");
    Assert.notNull(executorService,"executorService must be not null");
View Full Code Here

        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

        this.seeder = seeder;
        this.scheduledPolls = new ArrayList<PollDef>();
        this.scheduledTasks = new ArrayList<GeoRSSPollTask>();

        final int corePoolSize = 1;
        CustomizableThreadFactory tf = new CustomizableThreadFactory("GWC GeoRSS Poll Tasks-");
        tf.setDaemon(true);
        tf.setThreadPriority(Thread.MIN_PRIORITY + 1);
        schedulingPollExecutorService = Executors.newScheduledThreadPool(corePoolSize, tf);

        schedulingPollExecutorService.submit(new Runnable() {

            public void run() {
View Full Code Here

            } catch (IOException e) {
                throw new IOException("BDB DiskQuota could not read "+VERSION_FILE+" to detemine database version", e);
            }
        }
       
        CustomizableThreadFactory tf = new CustomizableThreadFactory("GWC DiskQuota Store Writer-");
        transactionRunner = Executors.newFixedThreadPool(1, tf);
        try {
            configure(storeDirectory);

            deleteStaleLayersAndCreateMissingTileSets();
View Full Code Here

    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

TOP

Related Classes of org.springframework.scheduling.concurrent.CustomizableThreadFactory

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.