gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Interface PacketPool

All Known Implementing Classes:
PacketPoolBySize, PacketPoolHeap, PacketPoolSimple

public interface PacketPool

A packet pool manages a pool of packets for reuse. It does not track where the packet have gone and leaves it up to user to ensure good behavior and put no longer needed packets back in the pool.


Method Summary
 void drain()
          Return all packets in the pool back to the Java heap.
 void flush(java.util.List<Packet> packetList)
          Take all the packets on the supplied list and hang them on the internal pool list
 Packet get(int size)
          Get a packet of size
 void preen()
          Clean up the pool in some way
 void put(Packet packet)
          Give the packet to the pool for storage
 

Method Detail

get

Packet get(int size)
           throws RtStpsException
Get a packet of size

Parameters:
size - size in bytes needed hold packet including header and body
Returns:
Packet
Throws:
RtStpsException - If size is not legal

put

void put(Packet packet)
         throws RtStpsException
Give the packet to the pool for storage

Parameters:
packet -
Throws:
RtStpsException - If illegal size

flush

void flush(java.util.List<Packet> packetList)
           throws RtStpsException
Take all the packets on the supplied list and hang them on the internal pool list

Parameters:
packetList - the list of packets to put on the pool
Throws:
RtStpsException - if this fails

preen

void preen()
Clean up the pool in some way


drain

void drain()
Return all packets in the pool back to the Java heap.