com.caucho.bam.packet
Class Packet

java.lang.Object
  extended by com.caucho.bam.packet.Packet
Direct Known Subclasses:
Message, MessageError, Query, QueryError, QueryResult

public class Packet
extends java.lang.Object

Base packet class. Contains only a 'to' and a 'from' field.


Constructor Summary
Packet()
          null constructor for Hessian deserialization
Packet(java.lang.String to, java.lang.String from)
          Creates a packet with a destination and a source.
 
Method Summary
 void dispatch(MessageStream handler, MessageStream toSource)
          SPI method to dispatch the packet to the proper handler
 void dispatchError(MessageStream handler, MessageStream toSource, BamError error)
          SPI method to dispatch the packet to the proper handler
 java.lang.String getFrom()
          Returns the 'from' field
 java.lang.String getTo()
          Returns the 'to' field
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Packet

public Packet()
null constructor for Hessian deserialization


Packet

public Packet(java.lang.String to,
              java.lang.String from)
Creates a packet with a destination and a source.

Parameters:
to - the destination address
from - the source address
Method Detail

getTo

public final java.lang.String getTo()
Returns the 'to' field


getFrom

public final java.lang.String getFrom()
Returns the 'from' field


dispatch

public void dispatch(MessageStream handler,
                     MessageStream toSource)
SPI method to dispatch the packet to the proper handler


dispatchError

public void dispatchError(MessageStream handler,
                          MessageStream toSource,
                          BamError error)
SPI method to dispatch the packet to the proper handler


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object