Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue


    /**
     * Create the executor used to launch the single requestConnectionListener
     */
    public ExecutorService newListenerExecutor(int port) {
        return new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS,
                                      new LinkedBlockingQueue(),
                                      new DefaultThreadFactory(
                                              new ThreadGroup("Listener thread group"),
                                              "HttpListener-" + this.port));
    }
View Full Code Here


    /**
     * Create the queue used to hold incoming requests when requestCoreThreadPoolSize threads are busy.
     * Default is an unbounded queue.
     */
    public BlockingQueue newRequestBlockingQueue() {
        return new LinkedBlockingQueue();
    }
View Full Code Here

    public void start() throws AxisFault {
        // create thread pool of workers
        ExecutorService workerPool = new ThreadPoolExecutor(
                1,
                WORKERS_MAX_THREADS, WORKER_KEEP_ALIVE, TIME_UNIT,
                new LinkedBlockingQueue(),
                new org.apache.axis2.util.threadpool.DefaultThreadFactory(
                        new ThreadGroup("JMS Worker thread group"),
                        "JMSWorker"));

        Iterator iter = connectionFactories.values().iterator();
View Full Code Here

     * Creates a new instace with the default thread pool implementation
     * (<tt>new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue() )</tt>).
     */
    public ExecutorFilter() {
        this(new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS,
                new LinkedBlockingQueue()));
    }
View Full Code Here

    }

    protected Object createInstance() throws Exception {
        BlockingQueue queue = null;
        if (queueCapacity > 0) {
            queue = new LinkedBlockingQueue(queueCapacity);
        } else {
            queue = new SynchronousQueue();
        }
        return new ThreadPoolExecutor(corePoolSize, maxPoolSize,
                keepAliveSeconds, TimeUnit.SECONDS, queue, threadFactory,
View Full Code Here

    protected Object createInstance() throws Exception
    {
        BlockingQueue queue = null;
        if( queueCapacity > 0 )
        {
            queue = new LinkedBlockingQueue( queueCapacity );
        }
        else
        {
            queue = new SynchronousQueue();
        }
View Full Code Here

     * Creates a new instace with the default thread pool implementation
     * (<tt>new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue() )</tt>).
     */
    public ExecutorFilter()
    {
        this( new ThreadPoolExecutor(16, 16, 60, TimeUnit.SECONDS, new LinkedBlockingQueue() ) );
    }
View Full Code Here

     * one.
     *
     * @param maxSize Maximum size of the work executor pool.
     */
    public WorkExecutorPoolImpl(int maxSize) {
        pooledExecutor = new ThreadPoolExecutor(1, maxSize, 1, TimeUnit.MINUTES, new LinkedBlockingQueue());
        /*

        FIXME: How to do this with concurrent.util ?
        pooledExecutor.waitWhenBlocked();
        */
 
View Full Code Here

   * @see edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue
   * @see edu.emory.mathcs.backport.java.util.concurrent.SynchronousQueue
   */
  protected BlockingQueue createQueue(int queueCapacity) {
    if (queueCapacity > 0) {
      return new LinkedBlockingQueue(queueCapacity);
    }
    else {
      return new SynchronousQueue();
    }
  }
View Full Code Here

        this.transport = transport;
        this.clientIdGenerator = clientIdGenerator;
        this.factoryStats = factoryStats;
       
        // Configure a single threaded executor who's core thread can timeout if idle
        asyncConnectionThread = new ThreadPoolExecutor(1,1,5,TimeUnit.SECONDS, new LinkedBlockingQueue(), new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread thread = new Thread(r, "AcitveMQ Connection Worker: "+transport);
                thread.setDaemon(true);
                return thread;
            }});
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue

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.