org.jboss.netty.example.uptime
Class UptimeClientHandler

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

public class UptimeClientHandler
extends SimpleChannelUpstreamHandler

Keep reconnecting to the server while printing out the current uptime and connection attempt status.

Version:
$Rev: 2189 $, $Date: 2010-02-19 18:02:57 +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
UptimeClientHandler(ClientBootstrap bootstrap, Timer timer)
           
 
Method Summary
 void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
          Invoked when a Channel was closed and all its related resources were released.
 void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
          Invoked when a Channel is open, bound to a local address, and connected to a remote address.
 void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e)
          Invoked when a Channel was disconnected from its remote peer.
 void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
          Invoked when an exception was raised by an I/O thread or a ChannelHandler.
 
Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler
channelBound, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, messageReceived, writeComplete
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UptimeClientHandler

public UptimeClientHandler(ClientBootstrap bootstrap,
                           Timer timer)
Method Detail

channelDisconnected

public void channelDisconnected(ChannelHandlerContext ctx,
                                ChannelStateEvent e)
Description copied from class: SimpleChannelUpstreamHandler
Invoked when a Channel was disconnected from its remote peer.

Overrides:
channelDisconnected in class SimpleChannelUpstreamHandler

channelClosed

public void channelClosed(ChannelHandlerContext ctx,
                          ChannelStateEvent e)
Description copied from class: SimpleChannelUpstreamHandler
Invoked when a Channel was closed and all its related resources were released.

Overrides:
channelClosed in class SimpleChannelUpstreamHandler

channelConnected

public void channelConnected(ChannelHandlerContext ctx,
                             ChannelStateEvent e)
Description copied from class: SimpleChannelUpstreamHandler
Invoked when a Channel is open, bound to a local address, and connected to a remote address.

Overrides:
channelConnected 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.