Examples of LinkedBlockingQueue


Examples of java.util.concurrent.LinkedBlockingQueue

            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));
        }
// FIXME: This API is only in JDK 1.6 - Use reflection?       
//        rc.allowCoreThreadTimeOut(true);
        return rc;
View Full Code Here

Examples of java.util.concurrent.LinkedBlockingQueue

                "threadPool_shared = " + sharedPool,
                x
                );
        }

        cErrorThreadPool = new ThreadPoolExecutor(20, 20, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(), new PriorityThreadFactory(threadPriority, "ErrorRendering", PortalSessionManager.getThreadGroup()));

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

Examples of java.util.concurrent.LinkedBlockingQueue

  /** Priority of Threads. */
  private int threadPriority = DEFAULT_THREAD_PRIORITY;

  protected void afterPropertiesSetInternal() throws Exception {
    this.threadPool = new ThreadPoolExecutor(initialThreads, maxThreads,
        0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(),
        new PriorityThreadFactory(threadPriority, "Priority", PortalSessionManager.getThreadGroup()));
  }
View Full Code Here

Examples of java.util.concurrent.LinkedBlockingQueue

    protected void doSetUp() throws Exception
    {
        super.doSetUp();

        // allow 1 active & 1 queued Thread
        executor = new ThreadPoolExecutor(1, 1, 10000L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue(1));
        executor.prestartAllCoreThreads();

        // the lock must be fair to guarantee FIFO access to the executor;
        // 'synchronized' on a monitor is not good enough.
        executorLock = new ReentrantLock(true);
View Full Code Here

Examples of java.util.concurrent.LinkedBlockingQueue

     */
    public Channel(String name, ChannelHandler<T> channelHandler) {
        this.name = name;
        this.channelHandler = channelHandler;

        executor = new ThreadPoolExecutor(1, 8, 15, TimeUnit.SECONDS, new LinkedBlockingQueue());
    }
View Full Code Here

Examples of java.util.concurrent.LinkedBlockingQueue

        _arguments = arguments;
        _prefetchHigh = prefetchHigh;
        _prefetchLow = prefetchLow;
        _exclusive = exclusive;

        _synchronousQueue = new LinkedBlockingQueue();
        _autoClose = autoClose;
        _noConsume = noConsume;

        // Force queue browsers not to use acknowledge modes.
        if (_noConsume)
View Full Code Here

Examples of java.util.concurrent.LinkedBlockingQueue

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

Examples of java.util.concurrent.LinkedBlockingQueue

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

Examples of java.util.concurrent.LinkedBlockingQueue

        if (!threadPoolEnabled)
            return new NonParallelExecutor();

        final ThreadPoolExecutor executorService = new ThreadPoolExecutor(coreSize, maxSize, keepAliveMillis,
                TimeUnit.MILLISECONDS, new LinkedBlockingQueue());

        shutdownHub.addRegistryShutdownListener(new RegistryShutdownListener()
        {
            public void registryDidShutdown()
            {
View Full Code Here

Examples of java.util.concurrent.LinkedBlockingQueue

            throw new IllegalArgumentException("ListenerList cannot be null!");
        }

        m_eventAdmin = eventAdmin;
        m_listenerList = listenerList;
        m_eventQueue = new LinkedBlockingQueue();

        m_backgroundThread = new Thread(this, "UserAdmin event dispatcher");
    }
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.