Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.activeio.packet
Class PacketPool

    java.lang.Object
      org.activeio.packet.PacketPool

Direct Known Subclasses:
  ByteBufferPacketPool

public abstract class PacketPool
extends java.lang.Object

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
`class` | `PacketPool.PooledPacket`

Field Summary
`static int` | `DEFAULT_PACKET_SIZE`
`static int` | `DEFAULT_POOL_SIZE`

Constructor Summary
`PacketPool(int maxPackets)`

Method Summary
`protected abstract Packet` | `allocateNewPacket()`
`Packet` | `getPacket()` Blocks until a ByteBuffer can be retreived from the pool.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_POOL_SIZE

    public static final int DEFAULT_POOL_SIZE

### DEFAULT_PACKET_SIZE

    public static final int DEFAULT_PACKET_SIZE

Constructor Detail

### PacketPool

    public PacketPool(int maxPackets)

Parameters:
  `maxPackets` - the number of buffers that will be in the pool.

Method Detail

### getPacket

    public Packet getPacket()
                     throws java.lang.InterruptedException

  Blocks until a ByteBuffer can be retreived from the pool.

  Returns:
  Throws:
    `java.lang.InterruptedException`

### allocateNewPacket

    protected abstract Packet allocateNewPacket()

  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © -2005 The ActiveIO Project. All Rights Reserved.