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 TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) io.netty.channel.EventLoopgetLoop()final HostgetPeer()final Attributeslonglonglonglongfinal AttributeslonglonglonglongbooleanbooleanvoiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) voidwrite(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, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaughtMethods inherited from class io.netty.channel.ChannelHandlerAdapter
handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemovedMethods 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:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
write
public void write(io.netty.channel.ChannelHandlerContext ctx, Object msg, io.netty.channel.ChannelPromise promise) - Specified by:
writein interfaceio.netty.channel.ChannelOutboundHandler- Overrides:
writein classio.netty.channel.ChannelDuplexHandler
-
userEventTriggered
- Specified by:
userEventTriggeredin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
userEventTriggeredin classio.netty.channel.ChannelInboundHandlerAdapter
-
getPeer
- Specified by:
getPeerin interfaceConnection<T>
-
getPeerAttributes
- Specified by:
getPeerAttributesin interfaceConnection<T>
-
getSelfAttributes
- Specified by:
getSelfAttributesin interfaceConnection<T>
-
isInbound
public boolean isInbound()- Specified by:
isInboundin interfaceConnection<T>
-
isOutbound
public boolean isOutbound()- Specified by:
isOutboundin interfaceConnection<T>
-
getLoop
public io.netty.channel.EventLoop getLoop()- Specified by:
getLoopin interfaceConnection<T>
-
getSentAppBytes
public long getSentAppBytes()- Specified by:
getSentAppBytesin interfaceConnection<T>
-
getSentAppMessages
public long getSentAppMessages()- Specified by:
getSentAppMessagesin interfaceConnection<T>
-
getSentControlBytes
public long getSentControlBytes()- Specified by:
getSentControlBytesin interfaceConnection<T>
-
getSentControlMessages
public long getSentControlMessages()- Specified by:
getSentControlMessagesin interfaceConnection<T>
-
getReceivedAppBytes
public long getReceivedAppBytes()- Specified by:
getReceivedAppBytesin interfaceConnection<T>
-
getReceivedAppMessages
public long getReceivedAppMessages()- Specified by:
getReceivedAppMessagesin interfaceConnection<T>
-
getReceivedControlBytes
public long getReceivedControlBytes()- Specified by:
getReceivedControlBytesin interfaceConnection<T>
-
getReceivedControlMessages
public long getReceivedControlMessages()- Specified by:
getReceivedControlMessagesin interfaceConnection<T>
-