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

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

Deprecated.

@Deprecated
public class PacketPoolSimple
extends java.lang.Object
implements PacketPool

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. This implements a single list of fixed max sized packets which are always resized to asked for size. Then when they are put back on the queue, they are resized back to their maximum. Chews up memory ... essentially deprecated.


Field Summary
private static int CCSDSMaxSize
          Deprecated.  
private static int CCSDSMinSize
          Deprecated.  
private static java.util.LinkedList<Packet> pool
          Deprecated.  
private static int totalCreated
          Deprecated.  
 
Constructor Summary
PacketPoolSimple()
          Deprecated.  
 
Method Summary
 void drain()
          Deprecated. Return all packets in the pool back to the Java heap.
 void flush(java.util.List<Packet> packetList)
          Deprecated. Take all the packets on the supplied list and hang them on the internal pool list
 Packet get(int size)
          Deprecated. Ask for a get a packet of size
 void preen()
          Deprecated. Clean up the pool in some way
 void put(Packet packet)
          Deprecated. 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
Deprecated. 
See Also:
Constant Field Values

CCSDSMinSize

private static final int CCSDSMinSize
Deprecated. 
See Also:
Constant Field Values

pool

private static java.util.LinkedList<Packet> pool
Deprecated. 

totalCreated

private static int totalCreated
Deprecated. 
Constructor Detail

PacketPoolSimple

public PacketPoolSimple()
Deprecated. 
Method Detail

get

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

put

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

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

flush

public void flush(java.util.List<Packet> packetList)
           throws RtStpsException
Deprecated. 
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

drain

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

Specified by:
drain in interface PacketPool

preen

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

Specified by:
preen in interface PacketPool