public class LocalTimeClientHandler extends SimpleChannelUpstreamHandler
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.BlockingQueue<LocalTimeProtocol.LocalTimes> |
answer |
private Channel |
channel |
private static java.util.regex.Pattern |
DELIM |
| Constructor and Description |
|---|
LocalTimeClientHandler() |
| Modifier and Type | Method and Description |
|---|---|
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. |
java.util.List<java.lang.String> |
getLocalTimes(java.util.Collection<java.lang.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. |
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelUnbound, childChannelClosed, childChannelOpen, writeCompleteprivate static final java.util.regex.Pattern DELIM
private volatile Channel channel
private final java.util.concurrent.BlockingQueue<LocalTimeProtocol.LocalTimes> answer
public java.util.List<java.lang.String> getLocalTimes(java.util.Collection<java.lang.String> cities)
public void handleUpstream(ChannelHandlerContext ctx, ChannelEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerhandleUpstream in interface ChannelUpstreamHandlerhandleUpstream in class SimpleChannelUpstreamHandlerctx - the context object for this handlere - the upstream event to process or interceptjava.lang.Exceptionpublic void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerChannel is open, but not bound nor connected.
channelOpen in class SimpleChannelUpstreamHandlerjava.lang.Exceptionpublic void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
SimpleChannelUpstreamHandlerChannelBuffer) was received
from a remote peer.messageReceived in class SimpleChannelUpstreamHandlerpublic void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
SimpleChannelUpstreamHandlerChannelHandler.exceptionCaught in class SimpleChannelUpstreamHandler