com.voytechs.jnetstream.codec.event
Class DecoderPacketEvent

java.lang.Object
  extended by com.voytechs.jnetstream.codec.event.DecoderEvent
      extended by com.voytechs.jnetstream.codec.event.DecoderPacketEvent

public class DecoderPacketEvent
extends DecoderEvent

Decoder event for new packets. When a new packet is created by the decoder this event is dispatched. Event is dispatched after the packet has been fully processed and assesed. You can retrieve the following information from this event.


Field Summary
static java.lang.String NAME
          Name of this event.
static java.lang.String TYPE
          Event type identifier.
 
Constructor Summary
DecoderPacketEvent(Packet packet, Decoder decoder)
          New Packet has been created event.
 
Method Summary
 Decoder getDecoder()
           Returns the Decoder object reference which generated this event.
 Packet getPacket()
          Returns the Packet object reference which generated this event.
 
Methods inherited from class com.voytechs.jnetstream.codec.event.DecoderEvent
getSubType, getType, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final java.lang.String TYPE
Event type identifier. This identifier can be used to identify this event type.

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Name of this event. This is a longer name and more descriptive name for this event.

See Also:
Constant Field Values
Constructor Detail

DecoderPacketEvent

public DecoderPacketEvent(Packet packet,
                          Decoder decoder)
New Packet has been created event. The event is initialized with a number of internal structures of the Decoder to aid in handling and allowing advanced processing to occur.

Parameters:
packet - The Packet that was constructed that caused the dispatch.
decoder - The decoder that is the parent of all of the internal structures.
Method Detail

getPacket

public Packet getPacket()
Returns the Packet object reference which generated this event.

Returns:
A reference to Packet object.

getDecoder

public Decoder getDecoder()

Returns the Decoder object reference which generated this event. This decoder was the one used to decode and generate the packet.

This is sometimes needed as multiple decoders can be used in unisome and allows tracking of which decoder the packets are comming from.

Returns:
A reference to Decoder object.