@ChannelHandler.Sharable public class NettyClientServerCommunicationSystemClientSide extends io.netty.channel.SimpleChannelInboundHandler<TOMMessage> implements CommunicationSystemClientSide
Modifier and Type | Field and Description |
---|---|
protected ReplyReceiver |
trr |
Constructor and Description |
---|
NettyClientServerCommunicationSystemClientSide(int clientId,
ClientViewController controller) |
Modifier and Type | Method and Description |
---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead0(io.netty.channel.ChannelHandlerContext context,
TOMMessage sm) |
void |
channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) |
void |
close() |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Throwable cause) |
void |
send(boolean sign,
int[] targets,
TOMMessage sm) |
void |
setReplyReceiver(ReplyReceiver trr) |
void |
sign(TOMMessage sm) |
byte[] |
signMessage(java.security.PrivateKey key,
byte[] message) |
void |
updateConnections() |
acceptInboundMessage, channelRead
channelReadComplete, channelRegistered, channelWritabilityChanged, userEventTriggered
handlerAdded, handlerRemoved, isSharable
protected ReplyReceiver trr
public NettyClientServerCommunicationSystemClientSide(int clientId, ClientViewController controller)
public void updateConnections()
updateConnections
in interface CommunicationSystemClientSide
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, java.lang.Throwable cause) throws java.lang.Exception
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception
public void channelRead0(io.netty.channel.ChannelHandlerContext context, TOMMessage sm) throws java.lang.Exception
channelRead0
in class io.netty.channel.SimpleChannelInboundHandler<TOMMessage>
java.lang.Exception
public void channelActive(io.netty.channel.ChannelHandlerContext ctx)
channelActive
in interface io.netty.channel.ChannelInboundHandler
channelActive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
channelInactive
in interface io.netty.channel.ChannelInboundHandler
channelInactive
in class io.netty.channel.ChannelInboundHandlerAdapter
public void setReplyReceiver(ReplyReceiver trr)
setReplyReceiver
in interface CommunicationSystemClientSide
public void send(boolean sign, int[] targets, TOMMessage sm)
send
in interface CommunicationSystemClientSide
public void sign(TOMMessage sm)
sign
in interface CommunicationSystemClientSide
public byte[] signMessage(java.security.PrivateKey key, byte[] message)
public void close()
close
in interface CommunicationSystemClientSide
public void channelUnregistered(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
channelUnregistered
in interface io.netty.channel.ChannelInboundHandler
channelUnregistered
in class io.netty.channel.ChannelInboundHandlerAdapter
java.lang.Exception