Class LocalTimeClientHandler
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.example.localtime.LocalTimeClientHandler
- All Implemented Interfaces:
ChannelHandler,ChannelUpstreamHandler
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockingQueue<LocalTimeProtocol.LocalTimes> private Channelprivate static final Pattern -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked when aChannelis open, but not bound nor connected.voidInvoked when an exception was raised by an I/O thread or aChannelHandler.getLocalTimes(Collection<String> cities) voidHandles the specified upstream event.voidInvoked 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
-
Field Details
-
DELIM
-
channel
-
answer
-
-
Constructor Details
-
LocalTimeClientHandler
public LocalTimeClientHandler()
-
-
Method Details
-
getLocalTimes
-
handleUpstream
Description copied from class:SimpleChannelUpstreamHandlerHandles 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:
handleUpstreamin interfaceChannelUpstreamHandler- Overrides:
handleUpstreamin classSimpleChannelUpstreamHandler- Parameters:
ctx- the context object for this handlere- the upstream event to process or intercept- Throws:
Exception
-
channelOpen
Description copied from class:SimpleChannelUpstreamHandlerInvoked when aChannelis 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:
channelOpenin classSimpleChannelUpstreamHandler- Throws:
Exception
-
messageReceived
Description copied from class:SimpleChannelUpstreamHandlerInvoked when a message object (e.g:ChannelBuffer) was received from a remote peer.- Overrides:
messageReceivedin classSimpleChannelUpstreamHandler
-
exceptionCaught
Description copied from class:SimpleChannelUpstreamHandlerInvoked when an exception was raised by an I/O thread or aChannelHandler.- Overrides:
exceptionCaughtin classSimpleChannelUpstreamHandler
-