Modifier and Type | Field and Description |
---|---|
protected Lock |
lock |
protected Condition |
notReady |
protected boolean |
ready |
protected Request |
resp |
protected long |
timeout |
protected AtomicLong |
transferredBytes |
Constructor and Description |
---|
ClientHandler()
default time out is 6000 millisecond
|
ClientHandler(long timeout) |
Modifier and Type | Method and Description |
---|---|
void |
channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
void |
channelInterestChanged(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelStateEvent e) |
protected void |
cleanUp() |
void |
exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ExceptionEvent e) |
void |
handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.ChannelEvent e) |
Response |
invoke(Request request,
org.jboss.netty.channel.Channel channel) |
void |
messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.MessageEvent e) |
void |
sendMessage(Request request,
org.jboss.netty.channel.Channel channel) |
Response |
sendRequest(Request request,
org.jboss.netty.channel.Channel channel) |
void |
writeComplete(org.jboss.netty.channel.ChannelHandlerContext ctx,
org.jboss.netty.channel.WriteCompletionEvent e) |
protected volatile boolean ready
protected final Lock lock
protected Condition notReady
protected final AtomicLong transferredBytes
protected long timeout
protected volatile Request resp
public ClientHandler()
public ClientHandler(long timeout)
timeout
- - request timeoutpublic void handleUpstream(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelEvent e) throws Exception
handleUpstream
in interface org.jboss.netty.channel.ChannelUpstreamHandler
handleUpstream
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
Exception
public void channelConnected(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
channelConnected
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
public void channelInterestChanged(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ChannelStateEvent e)
channelInterestChanged
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent e)
messageReceived
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
public void writeComplete(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.WriteCompletionEvent e)
writeComplete
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e)
exceptionCaught
in class org.jboss.netty.channel.SimpleChannelUpstreamHandler
public Response sendRequest(Request request, org.jboss.netty.channel.Channel channel)
sendRequest
in interface Send
request
- channel
- public void sendMessage(Request request, org.jboss.netty.channel.Channel channel)
sendMessage
in interface Send
protected void cleanUp()
Copyright © 2016. All rights reserved.