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

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


        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


        closed = new SynchronizedBoolean(false);
        started = new SynchronizedBoolean(false);
        outboundLock = new Object();
        if (useAsyncSend) {
            executor = new PooledExecutor(new BoundedBuffer(1000), 1);
        }
    }
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);
                            executor.waitWhenBlocked();
                            executor.setKeepAliveTime(1000);
                        }
                        TcpTransportChannel channel = createTransportChannel(socket, executor);
                        addClient(channel);
View Full Code Here

     */   
     public void setUseAsyncSend(boolean useAsyncSend) {
        this.useAsyncSend = useAsyncSend;
        try {
            if (useAsyncSend && executor==null ) {
                PooledExecutor pe = new PooledExecutor(new BoundedBuffer(10), 1);
                pe.waitWhenBlocked();
                pe.setKeepAliveTime(1000);
                executor = pe;
            }
            else if (!useAsyncSend && executor != null) {
View Full Code Here

        public ObjectDispatcherX(AsynchWriteAsynchChannelAdapter objectListener) {
            this(objectListener, 10);
        }

        public ObjectDispatcherX(AsynchWriteAsynchChannelAdapter objectListener, int queueSize) {
            this(objectListener, ChannelFactory.DEFAULT_EXECUTOR, new BoundedBuffer(queueSize));
        }
View Full Code Here

            this(objectListener, 10);
        }

        public ObjectDispatcher(AsynchWriteAsynchChannelAdapter objectListener, int queueSize) {
            this.objectListener = objectListener;
            executor = new PooledExecutor(new BoundedBuffer(queueSize), 1);
            executor.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

   
    public ThreadManagerImpl() {
       
        log.info("Intializing Thread Manager");
       
        backgroundExecutor = new PooledExecutor(new BoundedBuffer(10), 25);
        backgroundExecutor.setMinimumPoolSize(4);
        backgroundExecutor.setKeepAliveTime(1000 * 60 * 5);
        backgroundExecutor.waitWhenBlocked();
        backgroundExecutor.createThreads(9);
       
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

    */
   protected abstract boolean shouldEvictNode(NodeEntry ne);

   protected BaseEvictionAlgorithm()
   {
      recycleQueue = new BoundedBuffer(RegionManager.CAPACITY);
   }
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.