Package java.util.concurrent

Examples of java.util.concurrent.LinkedBlockingQueue$LBQSpliterator


            ThunkCreator thunkCreator)
    {

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

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


        if (!threadPoolEnabled)
            return new NonParallelExecutor();

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

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

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

            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

public class SedaConfigureTest extends ContextTestSupport {

    public void testBlockingQueueConfigured() throws Exception {
        SedaEndpoint endpoint = resolveMandatoryEndpoint("seda:foo?size=2000", SedaEndpoint.class);
        BlockingQueue<Exchange> queue = endpoint.getQueue();
        LinkedBlockingQueue blockingQueue = assertIsInstanceOf(LinkedBlockingQueue.class, queue);
        assertEquals("remainingCapacity", 2000, blockingQueue.remainingCapacity());
    }
View Full Code Here

    public CommandExecutor() {
    }

    public CommandExecutor(WorkingMemory workingMemory) {
        this.workingMemory = workingMemory;           
        this.queue = new LinkedBlockingQueue();
    }       
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));
        }
// FIXME: This API is only in JDK 1.6 - Use reflection?       
//        rc.allowCoreThreadTimeOut(true);
        return rc;
View Full Code Here

    ThreadPoolExecutor getExecutorService() {
        if (executorService == null) {
            synchronized (this) {
                //0, 10, 60000, ?, Integer.MAXVALUE
                executorService = new ThreadPoolExecutor(EXECUTOR_CORE_POOL_SIZE, EXECUTOR_MAXIMUM_POOL_SIZE,
                        EXECUTOR_KEEP_ALIVE_TIME, TimeUnit.MILLISECONDS, new LinkedBlockingQueue());
            }
        }
        return executorService;
    }
View Full Code Here

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

TOP

Related Classes of java.util.concurrent.LinkedBlockingQueue$LBQSpliterator

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.