Package org.jboss.netty.example.proxy
Class HexDumpProxyInboundHandler
- java.lang.Object
-
- org.jboss.netty.channel.SimpleChannelUpstreamHandler
-
- org.jboss.netty.example.proxy.HexDumpProxyInboundHandler
-
- All Implemented Interfaces:
ChannelHandler,ChannelUpstreamHandler
public class HexDumpProxyInboundHandler extends SimpleChannelUpstreamHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classHexDumpProxyInboundHandler.OutboundHandler-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private ClientSocketChannelFactorycfprivate ChanneloutboundChannel(package private) java.lang.ObjecttrafficLock
-
Constructor Summary
Constructors Constructor Description HexDumpProxyInboundHandler(ClientSocketChannelFactory cf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchannelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)Invoked when aChannelwas closed and all its related resources were released.voidchannelInterestChanged(ChannelHandlerContext ctx, ChannelStateEvent e)Invoked when aChannel'sinterestOpswas changed.voidchannelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)Invoked when aChannelis open, but not bound nor connected.(package private) static voidcloseOnFlush(Channel ch)Closes the specified channel after all queued write requests are flushed.voidexceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)Invoked when an exception was raised by an I/O thread or aChannelHandler.voidmessageReceived(ChannelHandlerContext ctx, MessageEvent e)Invoked when a message object (e.g:ChannelBuffer) was received from a remote peer.-
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelConnected, channelDisconnected, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete
-
-
-
-
Field Detail
-
cf
private final ClientSocketChannelFactory cf
-
trafficLock
final java.lang.Object trafficLock
-
outboundChannel
private volatile Channel outboundChannel
-
-
Constructor Detail
-
HexDumpProxyInboundHandler
public HexDumpProxyInboundHandler(ClientSocketChannelFactory cf)
-
-
Method Detail
-
channelOpen
public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when aChannelis open, but not bound nor connected.
Be aware that this event is fired from within the I/O thread. You should never execute any heavy operation in there as it will block the dispatching to other workers!- Overrides:
channelOpenin classSimpleChannelUpstreamHandler
-
messageReceived
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when a message object (e.g:ChannelBuffer) was received from a remote peer.- Overrides:
messageReceivedin classSimpleChannelUpstreamHandler
-
channelInterestChanged
public void channelInterestChanged(ChannelHandlerContext ctx, ChannelStateEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when aChannel'sinterestOpswas changed.- Overrides:
channelInterestChangedin classSimpleChannelUpstreamHandler
-
channelClosed
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when aChannelwas closed and all its related resources were released.- Overrides:
channelClosedin classSimpleChannelUpstreamHandler
-
exceptionCaught
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
Description copied from class:SimpleChannelUpstreamHandlerInvoked when an exception was raised by an I/O thread or aChannelHandler.- Overrides:
exceptionCaughtin classSimpleChannelUpstreamHandler
-
closeOnFlush
static void closeOnFlush(Channel ch)
Closes the specified channel after all queued write requests are flushed.
-
-