net.sf.cindy.decoder
Class PacketDecoderChain

java.lang.Object
  extended by net.sf.cindy.decoder.PacketDecoderChain
All Implemented Interfaces:
PacketDecoder

public class PacketDecoderChain
extends java.lang.Object
implements PacketDecoder

PacketDecoder chain.

Version:
$id$
Author:
Roger Chen

Constructor Summary
PacketDecoderChain()
           
 
Method Summary
 PacketDecoderChain addPacketDecoder(PacketDecoder decoder)
           
 java.lang.Object decode(Session session, Packet packet)
          Decode packet to object.
 PacketDecoderChain removePacketDecoder(PacketDecoder decoder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketDecoderChain

public PacketDecoderChain()
Method Detail

addPacketDecoder

public PacketDecoderChain addPacketDecoder(PacketDecoder decoder)

removePacketDecoder

public PacketDecoderChain removePacketDecoder(PacketDecoder decoder)

decode

public java.lang.Object decode(Session session,
                               Packet packet)
                        throws java.lang.Exception
Description copied from interface: PacketDecoder
Decode packet to object. The content of the packet is readonly, and it's position will not be changed if the method return null.

Specified by:
decode in interface PacketDecoder
Parameters:
session - session
packet - packet
Returns:
decoded object
Throws:
java.lang.Exception - any exception