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

Examples of EDU.oswego.cs.dl.util.concurrent.BoundedBuffer


    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);
        m_threadPool.setMinimumPoolSize(threadPoolMinSize);
        if (waitWhenBlocked) {
            m_threadPool.waitWhenBlocked();
View Full Code Here


                    }
                    else {
                        // 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.copy(), 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);
        }
        super.setCachingEnabled(true);
    }
View Full Code Here

                                         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);
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

        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        outboundLock = new Object();
        if (useAsyncSend) {
            executor = new PooledExecutor(new BoundedBuffer(1000), 1);
        }
    }
View Full Code Here

                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

    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

        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();
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.BoundedBuffer

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.