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

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


      // private ArrayBlockingQueue queue;

      public PanelInputStream(int maxSize) {
         // boolean orderedFIFO = true;
         // this.queue = new ArrayBlockingQueue(maxSize, orderedFIFO);
         this.queue = new BoundedBuffer(maxSize);
      }
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

        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

    /**
     * subclasses override to provide their own queue implementation
     */
    protected Channel createQueue()
    {
        return new BoundedBuffer(1500);
    }
View Full Code Here

    /**
     * set the max capacity of the queue
     */
    public synchronized void setQueueLimit(int size)
    {
        this.queue = new BoundedBuffer(size);
    }
View Full Code Here

    /**
     * subclasses override to provide their own queue implementation
     */
    protected Channel createQueue()
    {
        return new BoundedBuffer(5000);
    }
View Full Code Here

    /**
     * set the max capacity of the queue
     */
    public synchronized void setQueueLimit(int size)
    {
        this.queue = new BoundedBuffer(size);
    }
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

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

        if (useQueueing) {
            if (queueSize > 0) {
                this.executor = new PooledExecutor(new BoundedBuffer(queueSize));
            } else {
                this.executor = new PooledExecutor(new LinkedQueue());
            }
        } else {
            this.executor = new PooledExecutor();
View Full Code Here

        if ( pool.getQueue() != null )
        {
            if ( pool.getQueue() instanceof BoundedBuffer )
            {
                BoundedBuffer bb = (BoundedBuffer) pool.getQueue();
                se = new StatElement();
                se.setName( "Queue Size" );
                se.setData( "" + bb.size() );
                elems.add( se );

                se = new StatElement();
                se.setName( "Queue Capacity" );
                se.setData( "" + bb.capacity() );
                elems.add( se );
            }
        }

        se = new StatElement();
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.