Package java.util.concurrent

Examples of java.util.concurrent.ThreadPoolExecutor$Worker


  private HashMap<Class, AgentService> agentServices = new HashMap<Class, AgentService>();
  private ResourceRequestHandler resourceRequestHandler = new ResourceRequestHandler();
  private ThreadPoolExecutor agentBroadcastExecutor;

  private DefaultAgentManager() {
    agentBroadcastExecutor = new ThreadPoolExecutor(1, 5, 30, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(1000));
  }
View Full Code Here


        this.repositoryAgeMax = Long.MAX_VALUE;
        this.repositorySizeMax = Long.MAX_VALUE;
        this.trimall = trimall;

        // init the thread pool for the keeperOf executor service
        this.executor = new ThreadPoolExecutor(
            Runtime.getRuntime().availableProcessors() + 1,
            Runtime.getRuntime().availableProcessors() * 4, 100,
            TimeUnit.MILLISECONDS,
            new LinkedBlockingQueue<Runnable>(),
            new NamePrefixThreadFactory(prefix));
View Full Code Here

            tables.put(maxf, table);
        }
        assert this.current == null || this.tables.get(this.current) != null : "this.current = " + this.current;
       
        // init the thread pool for the keeperOf executor service
        this.executor = new ThreadPoolExecutor(
                Math.max(tables.size(), Runtime.getRuntime().availableProcessors()) + 1,
                Math.max(tables.size(), Runtime.getRuntime().availableProcessors()) + 1, 10,
                TimeUnit.SECONDS,
                new LinkedBlockingQueue<Runnable>(),
                new NamePrefixThreadFactory(prefix));
View Full Code Here

            int      maximumPoolSize = 10;
            long     keepAliveTime   = 1;
            TimeUnit unit            = TimeUnit.SECONDS;

            JDBCSQLXML.workQueue = new ArrayBlockingQueue<Runnable>(10);
            JDBCSQLXML.executorService = new ThreadPoolExecutor(corePoolSize,
                    maximumPoolSize, keepAliveTime, unit, workQueue);
        }

        return executorService;
    }
View Full Code Here

    // Stop iconsLoader of iconManager
    IconManager iconManager = IconManager.getInstance();
    iconManager.clear();
    // Replace icon manager by an executor that controls the start of a task with a barrier
    final CyclicBarrier iconLoadingStartBarrier = new CyclicBarrier(2);
    final ThreadPoolExecutor replacingIconsLoader =
      new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()) {
        @Override
        protected void beforeExecute(Thread t, Runnable r) {
          super.beforeExecute(t, r);
          awaitBarrier(iconLoadingStartBarrier);
        }
View Full Code Here

        }
        if (runningTask != null) {
            throw new IllegalStateException("A task is still executing");
        }
        if (executor == null) {
            this.executor = new ThreadPoolExecutor(0, 1, 15, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new NamedThreadFactory());
        }
        if (errorHandler != null) {
            this.errorHandler = errorHandler;
        }
        runningTask = new RunningLongTask(task, runnable, taskName);
View Full Code Here

    private Runnable dragSegment;
    private Runnable refreshLimitsSegment;
    private Runnable mouseClickSegment;

    private void initPools() {
        pool1 = new ThreadPoolExecutor(0, 4, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() {

            public Thread newThread(Runnable r) {
                Thread t = new Thread(r, "VisualizationThreadPool 1");
                t.setDaemon(true);
                return t;
            }
        }) {

            @Override
            protected void afterExecute(Runnable r, Throwable t) {
                super.afterExecute(r, t);
                pool1Semaphore.release();
            }

            @Override
            public void execute(Runnable command) {
                super.execute(command);
            }
        };

        pool2 = new ThreadPoolExecutor(0, 4, 60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>(), new ThreadFactory() {

            public Thread newThread(Runnable r) {
                Thread t = new Thread(r, "VisualizationThreadPool 2");
                t.setDaemon(true);
                return t;
View Full Code Here

    //
    private ThreadPoolExecutor pool;
    private VizEventTypeHandler[] handlers;

    public StandardVizEventManager() {
        pool = new ThreadPoolExecutor(0, 1, 60L, TimeUnit.SECONDS, new LinkedBlockingDeque<Runnable>(10));
    }
View Full Code Here

            }
        });
        pieChart.setChartVisible(pieButton.isSelected());

        //Event manager
        consumerThread = new ThreadPoolExecutor(0, 1, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(5), new ThreadFactory() {

            public Thread newThread(Runnable r) {
                Thread t = new Thread(r, "Context Panel consumer thread");
                t.setDaemon(true);
                return t;
View Full Code Here

        posix = POSIXFactory.getPOSIX(new JRubyPOSIXHandler(this), RubyInstanceConfig.nativeEnabled);
        javaSupport = new JavaSupport(this);
       
        if (RubyInstanceConfig.POOLING_ENABLED) {
            Executors.newCachedThreadPool();
            executor = new ThreadPoolExecutor(
                    RubyInstanceConfig.POOL_MIN,
                    RubyInstanceConfig.POOL_MAX,
                    RubyInstanceConfig.POOL_TTL,
                    TimeUnit.SECONDS,
                    new SynchronousQueue<Runnable>(),
View Full Code Here

TOP

Related Classes of java.util.concurrent.ThreadPoolExecutor$Worker

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.