org.jboss.netty.example.localtime
Class LocalTimeClientHandler

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by org.jboss.netty.example.localtime.LocalTimeClientHandler
All Implemented Interfaces:
ChannelHandler, ChannelUpstreamHandler

public class LocalTimeClientHandler
extends SimpleChannelUpstreamHandler

Version:
$Rev: 2190 $, $Date: 2010-02-19 18:08:01 +0900 (Fri, 19 Feb 2010) $
Author:
The Netty Project, Trustin Lee

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable
 
Constructor Summary
LocalTimeClientHandler()
           
 
Method Summary
 void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e)
          Invoked when a Channel is open, but not bound nor connected.
 void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
          Invoked when an exception was raised by an I/O thread or a ChannelHandler.
 List<String> getLocalTimes(Collection<String> cities)
           
 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, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalTimeClientHandler

public LocalTimeClientHandler()
Method Detail

getLocalTimes

public List<String> getLocalTimes(Collection<String> cities)

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 handler
e - the upstream event to process or intercept
Throws:
Exception

channelOpen

public void channelOpen(ChannelHandlerContext ctx,
                        ChannelStateEvent e)
                 throws Exception
Description copied from class: SimpleChannelUpstreamHandler
Invoked when a Channel is open, but not bound nor connected.

Overrides:
channelOpen in class SimpleChannelUpstreamHandler
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

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.