edu.rit.m2mp
Class PacketPool

java.lang.Object
  extended by edu.rit.m2mp.PacketPool

public class PacketPool
extends Object

Class PacketPool provides a pool of M2MP Packets.

Note: Class PacketPool is multiple thread safe.


Constructor Summary
PacketPool()
          Construct a new packet pool.
 
Method Summary
 Packet allocate()
          Allocate a packet from this packet pool.
 void deallocate(Packet thePacket)
          Deallocate a packet into this packet pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketPool

public PacketPool()
Construct a new packet pool.

Method Detail

allocate

public Packet allocate()
Allocate a packet from this packet pool.

Returns:
Packet.

deallocate

public void deallocate(Packet thePacket)
Deallocate a packet into this packet pool. The packet is made available for subsequent allocation.

Parameters:
thePacket - Packet.
Throws:
NullPointerException - (unchecked exception) Thrown if thePacket is null.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.