Examples of waitWhenBlocked()


Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

   }

   private PooledExecutor setupThreadPool()
   {
      PooledExecutor threadPool = new PooledExecutor(max_pool);
      threadPool.waitWhenBlocked();
      threadPool.setMinimumPoolSize(1);
      threadPool.setKeepAliveTime(pool_thread_keep_alive);
      threadPool.setThreadFactory(new ThreadFactory()
      {
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

    public void testPool() throws InterruptedException {
      long keepAlive = 30*1000;
        PooledExecutor executor = new PooledExecutor(5);
        executor.setMinimumPoolSize(1);
        executor.waitWhenBlocked();
        executor.setKeepAliveTime(keepAlive);
        executor.setThreadFactory(new ThreadFactory() {
            public Thread newThread(final Runnable command) {
              synchronized (poolLock) {
                    count++;
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

        {
            pool.runWhenBlocked();
        }
        else if ( config.getWhenBlockedPolicy().equals( IPoolConfiguration.POLICY_WAIT ) )
        {
            pool.waitWhenBlocked();
        }
        else if ( config.getWhenBlockedPolicy().equals( IPoolConfiguration.POLICY_ABORT ) )
        {
            pool.abortWhenBlocked();
        }
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

   }

   private PooledExecutor setupThreadPool()
   {
      PooledExecutor threadPool = new PooledExecutor(max_pool);
      threadPool.waitWhenBlocked();
      threadPool.setMinimumPoolSize(1);
      threadPool.setKeepAliveTime(pool_thread_keep_alive);
      threadPool.setThreadFactory(new ThreadFactory()
      {
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

                    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

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

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

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

                    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

Examples of EDU.oswego.cs.dl.util.concurrent.PooledExecutor.waitWhenBlocked()

     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) {
                stopExecutor(executor);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.