net.tomp2p.message
Class TomP2PDecoderTCP
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.handler.codec.frame.FrameDecoder
net.tomp2p.message.TomP2PDecoderTCP
- All Implemented Interfaces:
- org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler
public class TomP2PDecoderTCP
- extends org.jboss.netty.handler.codec.frame.FrameDecoder
The decoder first decodes the header. If this has been successful, then if
there is payload, then the payload is decoded. The TomP2P decoder can be used
to decode several messages in the same session as long as they are
sequential. This class is not thread safe.
- Author:
- Thomas Bocek
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
org.jboss.netty.channel.ChannelHandler.Sharable |
Method Summary |
protected Object |
decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.Channel channel,
org.jboss.netty.buffer.ChannelBuffer buffer)
|
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
|
Methods inherited from class org.jboss.netty.handler.codec.frame.FrameDecoder |
channelClosed, channelDisconnected, createCumulationDynamicBuffer, decodeLast, messageReceived |
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler |
channelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TomP2PDecoderTCP
public TomP2PDecoderTCP()
TomP2PDecoderTCP
public TomP2PDecoderTCP(int maxMessageSize)
decode
protected Object decode(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.Channel channel,
org.jboss.netty.buffer.ChannelBuffer buffer)
throws Exception
- Specified by:
decode
in class org.jboss.netty.handler.codec.frame.FrameDecoder
- Throws:
Exception
exceptionCaught
public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e)
throws Exception
- Overrides:
exceptionCaught
in class org.jboss.netty.handler.codec.frame.FrameDecoder
- Throws:
Exception
Copyright © 2012. All Rights Reserved.