info.jedi.net
Class DefaultPacketHandler
java.lang.Object
|
+--info.jedi.net.DefaultPacketHandler
- Direct Known Subclasses:
- PingHandler, ReliableHandler, RMCHandler, UDPSender
- public class DefaultPacketHandler
- extends java.lang.Object
- implements PacketHandler
This is the default packet handler class. It ignores any
packet passed to it and returns true, signaling that processing
of that packet is complete.
- See Also:
PacketHandler
,
MailDaemon
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DefaultPacketHandler
public DefaultPacketHandler()
handlePacket
public boolean handlePacket(InputPacket packet)
throws java.io.IOException
- Ignores any packet passed to it and returns true,
signaling that processing of that packet is complete.
- Specified by:
- handlePacket in interface PacketHandler
- Returns:
- true, meaning that processing of this
packet is complete
- Throws:
- java.io.IOException - may be thrown by subclasses
handleError
public boolean handleError(java.lang.Exception e,
OutputPacket packet)
- Ignores error conditions, letting other handlers worry about
them.
- Specified by:
- handleError in interface PacketHandler
- Tags copied from interface: PacketHandler
- Parameters:
e
- the exception condition being handledpacket
- the packet that was being sent when the
error occurred- Returns:
- true if the error was properly dealt with; false
if the next higher PacketHandler should deal
with it.
initializePacket
public void initializePacket(OutputPacket packet)
throws java.io.IOException
- Does no initialization
- Specified by:
- initializePacket in interface PacketHandler
- Throws:
- java.io.IOException - may be thrown by subclasses
sendPacket
public boolean sendPacket(OutputPacket packet)
throws java.io.IOException
- Does nothing to send a packet; allows lower-level handler
to do their work.
- Specified by:
- sendPacket in interface PacketHandler
- Throws:
- java.io.IOException - may be thrown by subclasses