Class ConnectionHandler<T>
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
pt.unl.fct.di.novasys.network.pipeline.ConnectionHandler<T>
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
,Connection<T>
- Direct Known Subclasses:
InConnectionHandler
,OutConnectionHandler
public abstract class ConnectionHandler<T>
extends io.netty.channel.ChannelDuplexHandler
implements Connection<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionHandler
(MessageListener<T> consumer, io.netty.channel.EventLoop loop, boolean incoming, Attributes selfAttrs) -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelRead
(io.netty.channel.ChannelHandlerContext ctx, Object msg) io.netty.channel.EventLoop
getLoop()
final Host
getPeer()
final Attributes
long
long
long
long
final Attributes
long
long
long
long
boolean
boolean
void
userEventTriggered
(io.netty.channel.ChannelHandlerContext ctx, Object evt) void
write
(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
Methods inherited from interface pt.unl.fct.di.novasys.network.Connection
disconnect, sendMessage, sendMessage
-
Constructor Details
-
ConnectionHandler
public ConnectionHandler(MessageListener<T> consumer, io.netty.channel.EventLoop loop, boolean incoming, Attributes selfAttrs)
-
-
Method Details
-
channelRead
- Specified by:
channelRead
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
write
in interfaceio.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classio.netty.channel.ChannelDuplexHandler
-
userEventTriggered
- Specified by:
userEventTriggered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
userEventTriggered
in classio.netty.channel.ChannelInboundHandlerAdapter
-
getPeer
- Specified by:
getPeer
in interfaceConnection<T>
-
getPeerAttributes
- Specified by:
getPeerAttributes
in interfaceConnection<T>
-
getSelfAttributes
- Specified by:
getSelfAttributes
in interfaceConnection<T>
-
isInbound
public boolean isInbound()- Specified by:
isInbound
in interfaceConnection<T>
-
isOutbound
public boolean isOutbound()- Specified by:
isOutbound
in interfaceConnection<T>
-
getLoop
public io.netty.channel.EventLoop getLoop()- Specified by:
getLoop
in interfaceConnection<T>
-
getSentAppBytes
public long getSentAppBytes()- Specified by:
getSentAppBytes
in interfaceConnection<T>
-
getSentAppMessages
public long getSentAppMessages()- Specified by:
getSentAppMessages
in interfaceConnection<T>
-
getSentControlBytes
public long getSentControlBytes()- Specified by:
getSentControlBytes
in interfaceConnection<T>
-
getSentControlMessages
public long getSentControlMessages()- Specified by:
getSentControlMessages
in interfaceConnection<T>
-
getReceivedAppBytes
public long getReceivedAppBytes()- Specified by:
getReceivedAppBytes
in interfaceConnection<T>
-
getReceivedAppMessages
public long getReceivedAppMessages()- Specified by:
getReceivedAppMessages
in interfaceConnection<T>
-
getReceivedControlBytes
public long getReceivedControlBytes()- Specified by:
getReceivedControlBytes
in interfaceConnection<T>
-
getReceivedControlMessages
public long getReceivedControlMessages()- Specified by:
getReceivedControlMessages
in interfaceConnection<T>
-