com.cafesoft.core.message
Class PacketObjectPool

java.lang.Object
  |
  +--com.cafesoft.core.message.PacketObjectPool

public class PacketObjectPool
extends Object

An ObjectPool of Packet Objects

Since:
03/05/02
See Also:
Packet

Constructor Summary
PacketObjectPool(MessageServiceProvider msp)
          Create a new PacketObjectPool
 
Method Summary
 void close()
          Close the PacketObjectPool This method closes the ObjectPool and cleans up any dangling references.
 Packet getPacket()
          Get a Packet Object from the ObjectPool
 void initialize(Properties properties)
          Initialize the PacketObjectPool
 void releasePacket(Packet packet)
          Release the Packet Object back to the ObjectPool
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketObjectPool

public PacketObjectPool(MessageServiceProvider msp)
Create a new PacketObjectPool

Parameters:
msp - the MessageServiceProvider
Method Detail

initialize

public void initialize(Properties properties)
                throws LifecycleException
Initialize the PacketObjectPool

Parameters:
properties - the initialization Properties object
Throws:
LifecycleException - thrown if an error occurs initializing the PacketObjectPool

getPacket

public Packet getPacket()
                 throws PacketException
Get a Packet Object from the ObjectPool

Returns:
a Packet Object
Throws:
PacketException - thrown if an error occurs getting a Packet Object from the ObjectPool. Typically this will be some sort of Object creation error that occurs.

releasePacket

public void releasePacket(Packet packet)
Release the Packet Object back to the ObjectPool

Parameters:
packet - the Packet Object to release back to the ObjectPool
Throws:
IllegalArgumentException - thrown if the Packet parameter is null. Note: UNCHECKED EXCEPTION

close

public void close()
Close the PacketObjectPool

This method closes the ObjectPool and cleans up any dangling references.



Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.