@author Ilkka Priha @version $Id: BoundedBuffer.java 264148 2005-08-29 14:21:04Z henning $
@author Doug Lea @author Last changed by: $Author: gommma $ @version $Revision: 766 $ $Date: 2008-08-01 13:05:20 +0200 (ven, 01 ago 2008) $ @since ? (pre 2.1)
260261262263264265266267268269270
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();
139140141142143144145146147148149
} 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); } }
818283848586878889
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); }
178179180181182183184185186187188
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);
115116117118119120121122123124125
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(); }
6465666768697071
closed = new SynchronizedBoolean(false); started = new SynchronizedBoolean(false); outboundLock = new Object(); if (useAsyncSend) { executor = new PooledExecutor(new BoundedBuffer(1000), 1); } }
137138139140141142143144145146147
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); } }
7475767778798081
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); } }
146147148149150151152
* * @param capacity a capacity. */ public PoolBuffer(int capacity) { pool = new BoundedBuffer(capacity); }
280281282283284285286