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

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


        }
        else
        {
            if ( pool.getQueue() instanceof BoundedBuffer )
            {
                BoundedBuffer bb = (BoundedBuffer) pool.getQueue();
                return bb.size() == 0;
            }
            else
            {
                return true;
            }
View Full Code Here


        }
        else
        {
            if ( pool.getQueue() instanceof BoundedBuffer )
            {
                BoundedBuffer bb = (BoundedBuffer) pool.getQueue();
                return bb.size();
            }
            else
            {
                return 1;
            }
View Full Code Here

        {
            if ( log.isDebugEnabled() )
            {
                log.debug( "Creating a Bounded Buffer to use for the pool" );
            }
            queue = new BoundedBuffer( config.getBoundarySize() );
            pool = new PooledExecutor( queue, config.getMaximumPoolSize() );
            pool.setThreadFactory( new MyThreadFactory() );
        }
        else
        {
View Full Code Here

        this.multicastAddressString = multicastAddressString;
        this.multicastPort = multicastPort;
        this.cacheMgr = cacheMgr;

        // create a small thread pool to handle a barage
        pooledExecutor = new PooledExecutor( new BoundedBuffer( 100 ), maxPoolSize );
        pooledExecutor.discardOldestWhenBlocked();
        //pooledExecutor.setMinimumPoolSize(1);
        pooledExecutor.setThreadFactory( new MyThreadFactory() );

        if ( log.isInfoEnabled() )
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

        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

    this.instRep = instRep;
    Channel c = null;
    if (unlimitedQueue) {
      c = new LinkedQueue();
    } else {
      c = new BoundedBuffer(queueSize);
    }

    pool = new PooledExecutor(c, maxPoolSize);
    pool.setMinimumPoolSize(minPoolSize);
    pool.setKeepAliveTime(1000 * 60 * threadKeepAliveTime);
 
View Full Code Here

    */
   protected abstract boolean shouldEvictNode(NodeEntry ne);

   protected BaseEvictionAlgorithm()
   {
      recycleQueue = new BoundedBuffer(RegionManager.CAPACITY);
   }
View Full Code Here

  
   public static class MockEvictionAlgorithm extends BaseEvictionAlgorithm
   {
      public MockEvictionAlgorithm(int recycleQueueCapacity)
      {
         recycleQueue = new BoundedBuffer(recycleQueueCapacity);
      }
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, socket, executor);
                        addClient(channel);
                    }
                }
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.