Examples of ThreadPoolExecutor


Examples of java.util.concurrent.ThreadPoolExecutor

        return;
      }
    }

    log.debug("Initializing TCP thread pool...");
    this.tcpThreadPool = new ThreadPoolExecutor(this.tcpThreadPoolSize, this.tcpThreadPoolSize, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

    log.debug("Initializing UDP thread pool...");
    this.udpThreadPool = new ThreadPoolExecutor(this.udpThreadPoolSize, this.udpThreadPoolSize, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());

    Iterator<InetAddress> iaddr = addresses.iterator();
    while (iaddr.hasNext()) {
      InetAddress addr = iaddr.next();
      Iterator<Integer> iport = ports.iterator();
View Full Code Here

Examples of java.util.concurrent.ThreadPoolExecutor

  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

Examples of java.util.concurrent.ThreadPoolExecutor

        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

Examples of java.util.concurrent.ThreadPoolExecutor

            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

Examples of java.util.concurrent.ThreadPoolExecutor

            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

Examples of java.util.concurrent.ThreadPoolExecutor

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

Examples of java.util.concurrent.ThreadPoolExecutor

        }
        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

Examples of java.util.concurrent.ThreadPoolExecutor

    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

Examples of java.util.concurrent.ThreadPoolExecutor

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

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

Examples of java.util.concurrent.ThreadPoolExecutor

            }
        });
        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
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.