Class ThreadLocalStreamBufferPool
- java.lang.Object
-
- net.officefloor.server.stream.impl.AbstractStreamBufferPool<java.nio.ByteBuffer>
-
- net.officefloor.server.stream.impl.ThreadLocalStreamBufferPool
-
- All Implemented Interfaces:
ThreadCompletionListener,ThreadCompletionListenerFactory,StreamBufferPool<java.nio.ByteBuffer>
public class ThreadLocalStreamBufferPool extends AbstractStreamBufferPool<java.nio.ByteBuffer> implements ThreadCompletionListenerFactory, ThreadCompletionListener
- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.server.stream.impl.AbstractStreamBufferPool
AbstractStreamBufferPool.FileStreamBuffer, AbstractStreamBufferPool.UnpooledStreamBuffer
-
-
Constructor Summary
Constructors Constructor Description ThreadLocalStreamBufferPool(ByteBufferFactory byteBufferFactory, int maxThreadLocalPoolSize, int maxCorePoolSize)Instantiate with details of pool sizes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThreadCompletionListenercreateThreadCompletionListener(ManagedObjectPool pool)============= ThreadCompletionListenerFactory =========StreamBuffer<java.nio.ByteBuffer>getPooledStreamBuffer()=============== BufferPool ===========================intgetStreamBufferCount()Obtains the number ofStreamBufferinstances in circulation.voidthreadComplete()================= ThreadCompletionListener ============-
Methods inherited from class net.officefloor.server.stream.impl.AbstractStreamBufferPool
getFileStreamBuffer, getUnpooledStreamBuffer
-
-
-
-
Constructor Detail
-
ThreadLocalStreamBufferPool
public ThreadLocalStreamBufferPool(ByteBufferFactory byteBufferFactory, int maxThreadLocalPoolSize, int maxCorePoolSize)
Instantiate with details of pool sizes.
The total potential amount of memory used is:
pooledByteBufferSize* (active buffers+ (threadLocalPoolSize*active threads) +corePoolSize).- Parameters:
byteBufferFactory-ByteBufferFactory.maxThreadLocalPoolSize- MaximumThreadLocalpool size.maxCorePoolSize- Maximum core pool size.
-
-
Method Detail
-
getStreamBufferCount
public int getStreamBufferCount()
Obtains the number ofStreamBufferinstances in circulation.- Returns:
- Number of
StreamBufferinstances in circulation.
-
getPooledStreamBuffer
public StreamBuffer<java.nio.ByteBuffer> getPooledStreamBuffer()
=============== BufferPool ===========================- Specified by:
getPooledStreamBufferin interfaceStreamBufferPool<java.nio.ByteBuffer>- Returns:
StreamBuffer.
-
createThreadCompletionListener
public ThreadCompletionListener createThreadCompletionListener(ManagedObjectPool pool)
============= ThreadCompletionListenerFactory =========- Specified by:
createThreadCompletionListenerin interfaceThreadCompletionListenerFactory- Parameters:
pool-ManagedObjectPool.- Returns:
ThreadCompletionListenerfor theManagedObjectPool.
-
threadComplete
public void threadComplete()
================= ThreadCompletionListener ============- Specified by:
threadCompletein interfaceThreadCompletionListener
-
-