Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor


    /**
     * Creates a new DynamicPooledExecutor.
     */
    public DynamicPooledExecutor() {
        executor = new PooledExecutor();
        executor.setKeepAliveTime(500);
        adjustPoolSize();
    }
View Full Code Here


        if (backLog <= 0) {
            c = new SynchronousChannel();
        } else {
            c = new BoundedLinkedQueue(backLog);
        }
        this.executor = new PooledExecutor(c, poolSize);
        this.executor.setMinimumPoolSize(poolSize);
        this.executor.setBlockedExecutionHandler(
                new PooledExecutor.BlockedExecutionHandler() {
            public boolean blockedAction(Runnable command) {
                // execute with current thread and log message
View Full Code Here

    /**
     * Creates a new DynamicPooledExecutor.
     */
    public DynamicPooledExecutor() {
        executor = new PooledExecutor();
        executor.waitWhenBlocked();
        adjustPoolSize();
    }
View Full Code Here

    protected PooledExecutor threadPool;
   
   
    public NetworkConnector(BrokerContainer brokerContainer) {
        this.brokerContainer = brokerContainer;
        this.threadPool = new PooledExecutor();
    }
View Full Code Here

   /**
    * Creates a new DynamicPooledExecutor.
    */
   public DynamicPooledExecutor()
   {
      executor = new PooledExecutor();
      executor.waitWhenBlocked();
      adjustPoolSize();
   }
View Full Code Here

      c = new LinkedQueue();
    } else {
      c = new BoundedBuffer(queueSize);
    }

    pool = new PooledExecutor(c, maxPoolSize);
    pool.setMinimumPoolSize(minPoolSize);
    pool.setKeepAliveTime(1000 * 60 * threadKeepAliveTime);

    workerMap = new HashMap();

View Full Code Here

     * one.
     *
     * @param maxSize Maximum size of the work executor pool.
     */
    public WorkExecutorPoolImpl(int maxSize) {
        pooledExecutor = new PooledExecutor(new LinkedQueue(), maxSize);
        pooledExecutor.setMinimumPoolSize(maxSize);
        pooledExecutor.waitWhenBlocked();
    }
View Full Code Here

     * @param maxSize Maximum size of the work executor pool.
     */
    public WorkExecutorPoolImpl(
            Channel channel,
            int maxSize) {
        pooledExecutor = new PooledExecutor(channel, maxSize);
        pooledExecutor.setMinimumPoolSize(maxSize);
        pooledExecutor.waitWhenBlocked();
    }
View Full Code Here

     */
    synchronized public Executor getWorkManager() {
        if (workManager != null)
            return workManager;

        PooledExecutor p = new PooledExecutor();
        p.setKeepAliveTime(1000 * 30);
        p.setMinimumPoolSize(5);
        p.setMaximumPoolSize(Integer.MAX_VALUE);
        p.setThreadFactory(new ThreadFactory() {
            public Thread newThread(Runnable arg0) {
                return new Thread(arg0, "Remoting 'async' protocol worker " + getNextWorkerID());
            }
        });

View Full Code Here

    private int getNextWorkerID() {
        return nextWorkerID++;
    }

    public void doStart() throws WaitingException, Exception {
        PooledExecutor p = new PooledExecutor(new LinkedQueue(), poolSize);
        p.setKeepAliveTime(keepAliveTime);
        p.setMinimumPoolSize(poolSize);
        p.setThreadFactory(new ThreadFactory() {
            public Thread newThread(Runnable arg0) {
                return new Thread(arg0, poolName + " " + getNextWorkerID());
            }
        });
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.PooledExecutor

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.