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

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


            Socket socket = null;
            try {
                socket = serverSocket.accept();
                if (socket != null) {
                    // have thread per channel for sending messages and a thread for receiving them
                    PooledExecutor executor = null;
                    if (useAsyncSend) {
                        executor = new PooledExecutor(new BoundedBuffer(maxOutstandingMessages), 1);
                    }
                    TcpTransportChannel channel = new TcpTransportChannel(wireFormat, socket, executor);
                    addClient(channel);
                }
            }
View Full Code Here


        started = new SynchronizedBoolean(false);
        // there's not much point logging all exceptions, lets just keep a few around
        exceptionsList = new BoundedLinkedQueue(10);
        outboundLock = new Object();
        if (useAsyncSend) {
            executor = new PooledExecutor(new BoundedBuffer(1000), 1);
        }
    }
View Full Code Here

    public void testAsyncProxy() throws Exception {
        MockServer service = new MockServerImpl();
       
        // thread pool to execute tasks in
        PooledExecutor executor = new PooledExecutor(1);
       
        // async proxy
        MockServer proxy = (MockServer) AsyncProxy.createProxy(MockServer.class, service, executor);

        // lets make an async call
View Full Code Here

    protected void createBoundedThreadPool(final int threadPoolMaxSize,
                                           final int threadPoolMinSize,
                                           final int threadPoolInitSize,
                                           final int keepAliveTime,
                                           final boolean waitWhenBlocked) {
        m_threadPool = new PooledExecutor(new BoundedBuffer(threadPoolInitSize), threadPoolMaxSize);
        m_threadPool.setKeepAliveTime(keepAliveTime);
        m_threadPool.createThreads(threadPoolInitSize);
        m_threadPool.setMinimumPoolSize(threadPoolMinSize);
        if (waitWhenBlocked) {
            m_threadPool.waitWhenBlocked();
View Full Code Here

     * @param keepAliveTime
     */
    protected void createDynamicThreadPool(final int threadPoolMinSize,
                                           final int threadPoolInitSize,
                                           final int keepAliveTime) {
        m_threadPool = new PooledExecutor(new LinkedQueue());
        m_threadPool.setKeepAliveTime(keepAliveTime);
        m_threadPool.createThreads(threadPoolInitSize);
        m_threadPool.setMinimumPoolSize(threadPoolMinSize);
    }
View Full Code Here

        final boolean useQueueing = poolConfig.getChild("use-queueing").getValueAsBoolean(false);
        final int queueSize = poolConfig.getChild("queue-size").getValueAsInteger(-1);

        if (useQueueing) {
            if (queueSize > 0) {
                m_executor = new PooledExecutor(new BoundedBuffer(queueSize));
            } else {
                m_executor = new PooledExecutor(new LinkedQueue());
            }
        } else {
            m_executor = new PooledExecutor();
        }

        final int maxPoolSize = poolConfig.getChild("max-pool-size").getValueAsInteger(-1);

        if (maxPoolSize > 0) {
View Full Code Here

    private void createBoundedThreadPool(final int threadPoolMaxSize,
                                         final int threadPoolMinSize,
                                         final int threadPoolInitSize,
                                         final int keepAliveTime,
                                         final boolean waitWhenBlocked) {
        m_threadPool = new PooledExecutor(
                new BoundedBuffer(threadPoolInitSize),
                threadPoolMaxSize
        );
        m_threadPool.setKeepAliveTime(keepAliveTime);
        m_threadPool.createThreads(threadPoolInitSize);
View Full Code Here

     * @param keepAliveTime
     */
    private void createDynamicThreadPool(final int threadPoolMinSize,
                                         final int threadPoolInitSize,
                                         final int keepAliveTime) {
        m_threadPool = new PooledExecutor(new LinkedQueue());
        m_threadPool.setKeepAliveTime(keepAliveTime);
        m_threadPool.createThreads(threadPoolInitSize);
        m_threadPool.setMinimumPoolSize(threadPoolMinSize);
    }
View Full Code Here

            final int threadPoolMaxSize,
            final int threadPoolMinSize,
            final int threadPoolInitSize,
            final int keepAliveTime,
            final boolean waitWhenBlocked) {
        m_threadPool = new PooledExecutor(new BoundedBuffer(threadPoolInitSize), threadPoolMaxSize);
        m_threadPool.setKeepAliveTime(keepAliveTime);
        m_threadPool.createThreads(threadPoolInitSize);
        m_threadPool.setMinimumPoolSize(threadPoolMinSize);
        if (waitWhenBlocked) m_threadPool.waitWhenBlocked();
    }
View Full Code Here

     */
    protected void createDynamicThreadPool(
            final int threadPoolMinSize,
            final int threadPoolInitSize,
            final int keepAliveTime) {
        m_threadPool = new PooledExecutor(new LinkedQueue());
        m_threadPool.setKeepAliveTime(keepAliveTime);
        m_threadPool.createThreads(threadPoolInitSize);
        m_threadPool.setMinimumPoolSize(threadPoolMinSize);
    }
View Full Code Here

TOP

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

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.