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

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


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


        log.debug("Using backport of the util.concurrent package..");
        executor = new ThreadPoolExecutor(
            core, max, keepAlive,
            TimeUnit.SECONDS,
            queueLength == -1 ?
                new LinkedBlockingQueue() :
                new LinkedBlockingQueue(queueLength),
            new BackportThreadFactory(new ThreadGroup(threadGroupName), threadGroupId));
    }
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("XMPP Worker thread group"),
                        "XMPPWorker"));

        Iterator iter = connectionFactories.values().iterator();
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

   * @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

    public void start() throws AxisFault {
        // create thread pool of workers
        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

     * 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

     * Start this listener
     */
    public void start() throws AxisFault {
        workerPool = new ThreadPoolExecutor(1,
                                            WORKERS_MAX_THREADS, WORKER_KEEP_ALIVE, TIME_UNIT,
                                            new LinkedBlockingQueue(),
                                            new DefaultThreadFactory(
                                                    new ThreadGroup("Mail Worker thread group"),
                                                    "MailWorker"));

        messageQueue = new LinkedBlockingQueue();

        this.configurationContext.getThreadPool().execute(this);

        MailWorkerManager mailWorkerManager = new MailWorkerManager(configurationContext,
                                                                    messageQueue, workerPool,
View Full Code Here

                );
        }

        if( sharedPool )
        {
            cSharedThreadPool = new ThreadPoolExecutor(initialThreads, maxThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory(threadPriority));
        }
        else
        {
            this.mThreadPool = new ThreadPoolExecutor(initialThreads, maxThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory(threadPriority));
        }
    }
View Full Code Here

            rc = new ThreadPoolExecutor(corePoolSize, maxPoolSize, 10,
                    TimeUnit.SECONDS, new SynchronousQueue(),
                    new DefaultThreadFactory(name, daemon, priority));
        } else {
            rc = new ThreadPoolExecutor(corePoolSize, maxPoolSize, 10,
                    TimeUnit.SECONDS, new LinkedBlockingQueue(),
                    new DefaultThreadFactory(name, daemon, priority));
        }
        rc.allowCoreThreadTimeOut(true);
        return rc;
    }
View Full Code Here

TOP

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

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.