org.jboss.netty.example.factorial
Class FactorialServerHandler
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.example.factorial.FactorialServerHandler
- All Implemented Interfaces:
- ChannelHandler, ChannelUpstreamHandler
public class FactorialServerHandler
- extends SimpleChannelUpstreamHandler
Handler for a server-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.
- Version:
- $Rev: 2121 $, $Date: 2010-02-02 09:38:07 +0900 (Tue, 02 Feb 2010) $
- Author:
- The Netty Project, Trustin Lee
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FactorialServerHandler
public FactorialServerHandler()
handleUpstream
public void handleUpstream(ChannelHandlerContext ctx,
ChannelEvent e)
throws Exception
- Description copied from class:
SimpleChannelUpstreamHandler
- Handles the specified upstream event. Down-casts the received upstream event into more
meaningful sub-type event and calls an appropriate handler method with
the down-casted event.
- Specified by:
handleUpstream
in interface ChannelUpstreamHandler
- Overrides:
handleUpstream
in class SimpleChannelUpstreamHandler
- Parameters:
ctx
- the context object for this handlere
- the upstream event to process or intercept
- Throws:
Exception
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 class SimpleChannelUpstreamHandler
channelDisconnected
public void channelDisconnected(ChannelHandlerContext ctx,
ChannelStateEvent e)
throws Exception
- Description copied from class:
SimpleChannelUpstreamHandler
- Invoked when a
Channel
was disconnected from its remote peer.
- Overrides:
channelDisconnected
in class SimpleChannelUpstreamHandler
- Throws:
Exception
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 a
ChannelHandler
.
- Overrides:
exceptionCaught
in class SimpleChannelUpstreamHandler
Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.