|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.example.factorial.FactorialClientHandler
public class FactorialClientHandler
Handler for a client-side channel. This handler maintains stateful information which is specific to a certain channel using member variables. Therefore, an instance of this handler can cover only one channel. You have to create a new handler instance whenever you create a new channel and insert this handler to avoid a race condition.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler |
---|
ChannelHandler.Sharable |
Constructor Summary | |
---|---|
FactorialClientHandler(int count)
|
Method Summary | |
---|---|
void |
channelConnected(ChannelHandlerContext ctx,
ChannelStateEvent e)
Invoked when a Channel is open, bound to a local address, and
connected to a remote address. |
void |
channelInterestChanged(ChannelHandlerContext ctx,
ChannelStateEvent e)
Invoked when a Channel 's interestOps
was changed. |
void |
exceptionCaught(ChannelHandlerContext ctx,
ExceptionEvent e)
Invoked when an exception was raised by an I/O thread or a ChannelHandler . |
BigInteger |
getFactorial()
|
void |
handleUpstream(ChannelHandlerContext ctx,
ChannelEvent e)
Handles the specified upstream event. |
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, channelClosed, channelDisconnected, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, writeComplete |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FactorialClientHandler(int count)
Method Detail |
---|
public BigInteger getFactorial()
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws Exception
SimpleChannelUpstreamHandler
handleUpstream
in interface ChannelUpstreamHandler
handleUpstream
in class SimpleChannelUpstreamHandler
ctx
- the context object for this handlere
- the upstream event to process or intercept
Exception
public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
SimpleChannelUpstreamHandler
Channel
is open, bound to a local address, and
connected to a remote address.
channelConnected
in class SimpleChannelUpstreamHandler
public void channelInterestChanged(ChannelHandlerContext ctx, ChannelStateEvent e)
SimpleChannelUpstreamHandler
Channel
's interestOps
was changed.
channelInterestChanged
in class SimpleChannelUpstreamHandler
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
SimpleChannelUpstreamHandler
ChannelBuffer
) was received
from a remote peer.
messageReceived
in class SimpleChannelUpstreamHandler
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
SimpleChannelUpstreamHandler
ChannelHandler
.
exceptionCaught
in class SimpleChannelUpstreamHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |