Package org.apache.activeio.packet
Class PacketPool
java.lang.Object
org.apache.activeio.packet.PacketPool
- Direct Known Subclasses:
ByteBufferPacketPool
Provides a simple pool of Packet objects. When the packets that this pool produces are disposed,
they are returned to the pool.
- Version:
- $Revision: 1.1 $
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_POOL_SIZE
public static final int DEFAULT_POOL_SIZE -
DEFAULT_PACKET_SIZE
public static final int DEFAULT_PACKET_SIZE
-
-
Constructor Details
-
PacketPool
public PacketPool(int maxPackets) - Parameters:
maxPackets
- the number of buffers that will be in the pool.
-
-
Method Details
-
getPacket
Blocks until a ByteBuffer can be retreived from the pool.- Returns:
- Throws:
InterruptedException
-
dispose
public void dispose() -
waitForPacketsToReturn
public void waitForPacketsToReturn() -
allocateNewPacket
- Returns:
-