gov.nasa.gsfc.drl.rtstps.core.output.hdf5
Class PacketPoolHeap

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.PacketPoolHeap
All Implemented Interfaces:
PacketPool

public class PacketPoolHeap
extends java.lang.Object
implements PacketPool

This is not a true pool, it gets packets from the heap and gives them back to the heap


Field Summary
private  long packetsCreated
           
private  long packetsDestroyed
           
 
Constructor Summary
PacketPoolHeap(java.lang.String string, Stats stats)
           
 
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
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

packetsCreated

private long packetsCreated

packetsDestroyed

private long packetsDestroyed
Constructor Detail

PacketPoolHeap

public PacketPoolHeap(java.lang.String string,
                      Stats stats)
Method Detail

drain

public void drain()
Description copied from interface: PacketPool
Return all packets in the pool back to the Java heap.

Specified by:
drain in interface PacketPool

flush

public void flush(java.util.List<Packet> packetList)
           throws RtStpsException
Description copied from interface: PacketPool
Take all the packets on the supplied list and hang them on the internal pool list

Specified by:
flush in interface PacketPool
Parameters:
packetList - the list of packets to put on the pool
Throws:
RtStpsException - if this fails

get

public Packet get(int size)
           throws RtStpsException
Description copied from interface: PacketPool
Get a packet of size

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

preen

public void preen()
Description copied from interface: PacketPool
Clean up the pool in some way

Specified by:
preen in interface PacketPool

put

public void put(Packet packet)
         throws RtStpsException
Description copied from interface: PacketPool
Give the packet to the pool for storage

Specified by:
put in interface PacketPool
Throws:
RtStpsException - If illegal size

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object