Package java.util.concurrent

Examples of java.util.concurrent.ScheduledExecutorService


         PageCursorsInfo cursorACKs = PrintPages.loadCursorACKs(arg[1]);

         Set<Long> pgTXs = cursorACKs.getPgTXs();

         ScheduledExecutorService scheduled = Executors.newScheduledThreadPool(1);
         final ExecutorService executor = Executors.newFixedThreadPool(10);
         ExecutorFactory execfactory = new ExecutorFactory()
         {

            public Executor getExecutor()
View Full Code Here


      Settings settings = Settings.getInstance();
      settings.setAliasEnabled(false);
      console = new Console();
      context.setOutputAdapter(new ConsoleIOAdapter(console));
      console.addCompletion(new Completer(context));
      ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
      sessionPingTask = executor.scheduleWithFixedDelay(new PingTask(), SESSION_PING_TIMEOUT, SESSION_PING_TIMEOUT, TimeUnit.SECONDS);

      while (!context.isQuitting()) {
         try {
            context.refreshProperties();
            String line = console.read(getPrompt()).getBuffer();

            if (line != null) {
               if (!"".equals(line.trim())) {
                  execute(line);
               }
            }
         } catch (Exception e) {
            context.error(e);
         }
      }
      try {
         sessionPingTask.cancel(true);
         executor.shutdownNow();
         config.save();
         console.stop();
      } catch (Exception e) {
      }
   }
View Full Code Here

        if (oobExecutor != null) {
            if (!(transport.getOOBThreadPool() instanceof ManagedExecutorService)) {
                transport.setOOBThreadPool(new ManagedExecutorService(oobExecutor));
            }
        }
        ScheduledExecutorService timerExecutor = transportConfig.getTimerExecutor();
        if (timerExecutor != null) {
            if (!(transport.getTimer() instanceof TimerSchedulerAdapter)) {
                this.setValue(transport, "timer", new TimerSchedulerAdapter(new ManagedScheduledExecutorService(timerExecutor)));
            }
        }
View Full Code Here

    private final ILogger logger;

    public QueueService(NodeEngine nodeEngine) {
        this.nodeEngine = nodeEngine;
        ScheduledExecutorService defaultScheduledExecutor
                = nodeEngine.getExecutionService().getDefaultScheduledExecutor();
        QueueEvictionProcessor entryProcessor = new QueueEvictionProcessor(nodeEngine, this);
        this.queueEvictionScheduler = EntryTaskSchedulerFactory.newScheduler(
                defaultScheduledExecutor, entryProcessor, ScheduleType.POSTPONE);
        this.logger = nodeEngine.getLogger(QueueService.class);
View Full Code Here

            loadInitialKeys();

            if (mapStoreConfig.getWriteDelaySeconds() > 0) {
                final ExecutionService executionService = nodeEngine.getExecutionService();
                executionService.register(mapStoreScheduledExecutorName, 1, 100000, ExecutorType.CACHED);
                ScheduledExecutorService scheduledExecutor = executionService
                        .getScheduledExecutor(mapStoreScheduledExecutorName);
                mapStoreScheduler = EntryTaskSchedulerFactory.newScheduler(scheduledExecutor,
                        new MapStoreProcessor(this, mapService),
                        ScheduleType.FOR_EACH);
            } else {
                mapStoreScheduler = null;
            }
        } else {
            mapStoreScheduler = null;
        }
        ScheduledExecutorService defaultScheduledExecutor = nodeEngine.getExecutionService()
                .getDefaultScheduledExecutor();
        ttlEvictionScheduler = EntryTaskSchedulerFactory.newScheduler(defaultScheduledExecutor,
                new EvictionProcessor(nodeEngine, mapService, name), ScheduleType.POSTPONE);
        idleEvictionScheduler = EntryTaskSchedulerFactory.newScheduler(defaultScheduledExecutor,
                new EvictionProcessor(nodeEngine, mapService, name), ScheduleType.POSTPONE);
View Full Code Here

        migrationThread = new MigrationThread(node);
        proxy = new PartitionServiceProxy(this);

        replicaSyncRequests = new AtomicReferenceArray<ReplicaSyncInfo>(new ReplicaSyncInfo[partitionCount]);
        ScheduledExecutorService scheduledExecutor = nodeEngine.getExecutionService()
                .getDefaultScheduledExecutor();
        replicaSyncScheduler = EntryTaskSchedulerFactory.newScheduler(scheduledExecutor,
                new ReplicaSyncEntryProcessor(this), ScheduleType.SCHEDULE_IF_NEW);
    }
View Full Code Here

            RelativePathService.addService(pathService, path, relativeTo, serviceTarget);
        } else {
            AbsolutePathService.addService(pathService, path, serviceTarget);
        }
        final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("DeploymentScanner-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
        final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2, threadFactory);

        serviceTarget.addService(serviceName, service)
            .addDependency(pathService, String.class, service.pathValue)
            .addDependency(Services.JBOSS_SERVER_CONTROLLER, ServerController.class, service.serverControllerValue)
            .addDependency(ServerDeploymentRepository.SERVICE_NAME, ServerDeploymentRepository.class, service.deploymentRepositoryValue)
View Full Code Here

     * {@inheritDoc}
     * @see org.infinispan.executors.ScheduledExecutorFactory#getScheduledExecutor(java.util.Properties)
     */
    @Override
    public ScheduledExecutorService getScheduledExecutor(Properties properties) {
        ScheduledExecutorService executor = (ScheduledExecutorService) properties.get(EXECUTOR);
        if (executor == null) {
            throw MESSAGES.invalidExecutorProperty(EXECUTOR, properties);
        }
        return new ManagedScheduledExecutorService(executor);
    }
View Full Code Here

            RelativePathService.addService(pathService, path, false, relativeTo, serviceTarget, newControllers, listeners);
        } else {
            AbsolutePathService.addService(pathService, path, serviceTarget, newControllers, listeners);
        }
        final ThreadFactory threadFactory = new JBossThreadFactory(new ThreadGroup("DeploymentScanner-threads"), Boolean.FALSE, null, "%G - %t", null, null, AccessController.getContext());
        final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2, threadFactory);

        ServiceBuilder builder = serviceTarget.addService(serviceName, service)
                .addDependency(pathService, String.class, service.pathValue)
                .addDependency(Services.JBOSS_SERVER_CONTROLLER, ModelController.class, service.controllerValue)
                .addDependency(org.jboss.as.server.deployment.Services.JBOSS_DEPLOYMENT_CHAINS)
View Full Code Here

        if (oobExecutor != null) {
            if (!(transport.getOOBThreadPool() instanceof ManagedExecutorService)) {
                transport.setOOBThreadPool(new ManagedExecutorService(oobExecutor));
            }
        }
        ScheduledExecutorService timerExecutor = transportConfig.getTimerExecutor();
        if (timerExecutor != null) {
            if (!(transport.getTimer() instanceof TimerSchedulerAdapter)) {
                this.setValue(transport, "timer", new TimerSchedulerAdapter(new ManagedScheduledExecutorService(timerExecutor)));
            }
        }
View Full Code Here

TOP

Related Classes of java.util.concurrent.ScheduledExecutorService

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.