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

java.lang.Object
  extended by gov.nasa.gsfc.drl.rtstps.core.output.hdf5.PacketPoolOrig

public class PacketPoolOrig
extends java.lang.Object

A very simplistic pooling class for packets for use by the HDF output module only. It assumes good behavior by the user -- packets are created and given away and then the expectation is the user will put them back in the pool when done... if not they are lost to the garbage collector.


Field Summary
private static int CCSDSMaxSize
           
private static int CCSDSMinSize
           
private static Packets[] pool
           
private static int totalOnPool
           
 
Constructor Summary
PacketPoolOrig()
           
 
Method Summary
static void flush(java.util.List<Packet> packetList)
          Take all the packets on the supplied list and hang them on the internal pool list
static Packet get(int size)
          Ask for a get a packet of size
static void put(Packet packet)
          Give the packet to the pool for storage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CCSDSMaxSize

private static final int CCSDSMaxSize
See Also:
Constant Field Values

CCSDSMinSize

private static final int CCSDSMinSize
See Also:
Constant Field Values

pool

private static Packets[] pool

totalOnPool

private static int totalOnPool
Constructor Detail

PacketPoolOrig

public PacketPoolOrig()
Method Detail

get

public static Packet get(int size)
                  throws RtStpsException
Ask for a 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

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

Parameters:
packet -
Throws:
RtStpsException - If illegal size

flush

public static 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