ByteBufferPacketPoolpublic abstract class PacketPool extends Object
| Modifier and Type | Class | Description |
|---|---|---|
class |
PacketPool.PooledPacket |
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_PACKET_SIZE |
|
static int |
DEFAULT_POOL_SIZE |
| Constructor | Description |
|---|---|
PacketPool(int maxPackets) |
| Modifier and Type | Method | Description |
|---|---|---|
protected abstract Packet |
allocateNewPacket() |
|
void |
dispose() |
|
Packet |
getPacket() |
Blocks until a ByteBuffer can be retreived from the pool.
|
void |
waitForPacketsToReturn() |
public static final int DEFAULT_POOL_SIZE
public static final int DEFAULT_PACKET_SIZE
public PacketPool(int maxPackets)
maxPackets - the number of buffers that will be in the pool.public Packet getPacket() throws InterruptedException
InterruptedExceptionpublic void dispose()
public void waitForPacketsToReturn()
protected abstract Packet allocateNewPacket()
Copyright © 2005–2018. All rights reserved.