Class DefaultServerChannelInitializer
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
-
- org.drasyl.peer.connection.DefaultSessionInitializer
-
- org.drasyl.peer.connection.server.ServerChannelInitializer
-
- org.drasyl.peer.connection.server.DefaultServerChannelInitializer
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
public class DefaultServerChannelInitializer extends ServerChannelInitializer
Creates a newly configuredChannelPipeline
for the node server.
-
-
Field Summary
Fields Modifier and Type Field Description protected ServerEnvironment
environment
-
Fields inherited from class org.drasyl.peer.connection.DefaultSessionInitializer
IDLE_EVENT
-
-
Constructor Summary
Constructors Constructor Description DefaultServerChannelInitializer(ServerEnvironment environment)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterPojoMarshalStage(io.netty.channel.ChannelPipeline pipeline)
protected void
beforeMarshalStage(io.netty.channel.ChannelPipeline pipeline)
protected void
customStage(io.netty.channel.ChannelPipeline pipeline)
AddsChannelHandler
to theChannelPipeline
, after the default initialization has taken place.protected void
exceptionStage(io.netty.channel.ChannelPipeline pipeline)
AddsChannelHandler
for exception handling to theChannelPipeline
.protected io.netty.handler.ssl.SslHandler
generateSslContext(io.netty.channel.socket.SocketChannel ch)
Generates aSslHandler
that can be added to theChannelPipeline
.-
Methods inherited from class org.drasyl.peer.connection.DefaultSessionInitializer
afterBufferStage, afterExceptionStage, afterFilterStage, afterIdleStage, afterMarshalStage, afterSslStage, beforeBufferStage, beforeExceptionStage, beforeFilterStage, beforeIdleStage, beforePojoMarshalStage, beforeSslStage, bufferStage, filterStage, idleStage, initChannel, marshalStage, pojoMarshalStage, sslStage
-
Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
-
-
-
-
Field Detail
-
environment
protected final ServerEnvironment environment
-
-
Constructor Detail
-
DefaultServerChannelInitializer
public DefaultServerChannelInitializer(ServerEnvironment environment)
-
-
Method Detail
-
beforeMarshalStage
protected void beforeMarshalStage(io.netty.channel.ChannelPipeline pipeline)
- Specified by:
beforeMarshalStage
in classDefaultSessionInitializer
-
afterPojoMarshalStage
protected void afterPojoMarshalStage(io.netty.channel.ChannelPipeline pipeline)
- Overrides:
afterPojoMarshalStage
in classDefaultSessionInitializer
-
customStage
protected void customStage(io.netty.channel.ChannelPipeline pipeline)
Description copied from class:DefaultSessionInitializer
AddsChannelHandler
to theChannelPipeline
, after the default initialization has taken place.- Specified by:
customStage
in classDefaultSessionInitializer
- Parameters:
pipeline
- theChannelPipeline
-
exceptionStage
protected void exceptionStage(io.netty.channel.ChannelPipeline pipeline)
Description copied from class:DefaultSessionInitializer
AddsChannelHandler
for exception handling to theChannelPipeline
.- Overrides:
exceptionStage
in classDefaultSessionInitializer
- Parameters:
pipeline
- theChannelPipeline
-
generateSslContext
protected io.netty.handler.ssl.SslHandler generateSslContext(io.netty.channel.socket.SocketChannel ch) throws ServerException
Description copied from class:DefaultSessionInitializer
Generates aSslHandler
that can be added to theChannelPipeline
. If this method returnsnull
, the SslHandler is not added to theChannelPipeline
.- Specified by:
generateSslContext
in classDefaultSessionInitializer
- Parameters:
ch
- theSocketChannel
to initialize aSslHandler
- Returns:
SslHandler
ornull
- Throws:
ServerException
-
-