public class LocalExecClientHandler extends io.netty.channel.SimpleChannelInboundHandler<String>
Modifier and Type | Field and Description |
---|---|
protected StringBuilder |
back |
protected io.netty.channel.Channel |
channel |
protected String |
command |
protected long |
delay |
protected LocalExecClientInitializer |
factory |
protected boolean |
firstMessage |
protected WaarpFuture |
future |
protected WaarpFuture |
ready |
protected LocalExecResult |
result |
Constructor and Description |
---|
LocalExecClientHandler(LocalExecClientInitializer factory)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
actionBeforeClose(io.netty.channel.Channel channel)
Action to do before close
|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx)
When closed,
If no messaged were received => NoMessage error is set to future Else if an error was detected => Set the future to error (with or without exception) Else if no error occurs => Set success to the future |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
String mesg) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
void |
initExecClient(long delay,
String command)
Initialize the client status for a new execution
|
LocalExecResult |
waitFor(long delay)
Waiting for the close of the exec
|
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
protected LocalExecResult result
protected StringBuilder back
protected boolean firstMessage
protected WaarpFuture future
protected final LocalExecClientInitializer factory
protected long delay
protected String command
protected io.netty.channel.Channel channel
protected final WaarpFuture ready
public LocalExecClientHandler(LocalExecClientInitializer factory)
public void initExecClient(long delay, String command)
delay
- command
- public void channelActive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx) throws Exception
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
public LocalExecResult waitFor(long delay)
public void actionBeforeClose(io.netty.channel.Channel channel)
protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, String mesg) throws Exception
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Exception
Copyright © 2009–2020 Waarp. All rights reserved.