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 class
HexDumpProxyInboundHandler.OutboundHandler
-
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Field Summary
Fields Modifier and Type Field Description private ClientSocketChannelFactory
cf
private Channel
outboundChannel
(package private) java.lang.Object
trafficLock
-
Constructor Summary
Constructors Constructor Description HexDumpProxyInboundHandler(ClientSocketChannelFactory cf)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
Invoked when aChannel
was closed and all its related resources were released.void
channelInterestChanged(ChannelHandlerContext ctx, ChannelStateEvent e)
Invoked when aChannel
'sinterestOps
was changed.void
channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
Invoked when aChannel
is open, but not bound nor connected.(package private) static void
closeOnFlush(Channel ch)
Closes the specified channel after all queued write requests are flushed.void
exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
Invoked when an exception was raised by an I/O thread or aChannelHandler
.void
messageReceived(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:SimpleChannelUpstreamHandler
Invoked when aChannel
is 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:
channelOpen
in classSimpleChannelUpstreamHandler
-
messageReceived
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
Description copied from class:SimpleChannelUpstreamHandler
Invoked when a message object (e.g:ChannelBuffer
) was received from a remote peer.- Overrides:
messageReceived
in classSimpleChannelUpstreamHandler
-
channelInterestChanged
public void channelInterestChanged(ChannelHandlerContext ctx, ChannelStateEvent e)
Description copied from class:SimpleChannelUpstreamHandler
Invoked when aChannel
'sinterestOps
was changed.- Overrides:
channelInterestChanged
in classSimpleChannelUpstreamHandler
-
channelClosed
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
Description copied from class:SimpleChannelUpstreamHandler
Invoked when aChannel
was closed and all its related resources were released.- Overrides:
channelClosed
in classSimpleChannelUpstreamHandler
-
exceptionCaught
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
Description copied from class:SimpleChannelUpstreamHandler
Invoked when an exception was raised by an I/O thread or aChannelHandler
.- Overrides:
exceptionCaught
in classSimpleChannelUpstreamHandler
-
closeOnFlush
static void closeOnFlush(Channel ch)
Closes the specified channel after all queued write requests are flushed.
-
-