Class DefaultOriginChannelInitializer
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelInitializer<io.netty.channel.Channel>
com.netflix.zuul.netty.connectionpool.OriginChannelInitializer
com.netflix.zuul.netty.connectionpool.DefaultOriginChannelInitializer
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
Default Origin Channel Initializer
Author: Arthur Gonigberg
Date: December 01, 2017
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final ConnectionPoolHandler
protected final HttpMetricsChannelHandler
protected final io.netty.handler.logging.LoggingHandler
static final String
-
Constructor Summary
ConstructorDescriptionDefaultOriginChannelInitializer
(ConnectionPoolConfig connPoolConfig, com.netflix.spectator.api.Registry spectatorRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addMethodBindingHandler
(io.netty.channel.ChannelPipeline pipeline) This method can be overridden to add your own MethodBinding handler for preserving thread locals or thread variables.protected io.netty.handler.ssl.SslContext
getClientSslContext
(com.netflix.spectator.api.Registry spectatorRegistry) This method can be overridden to create your own custom SSL contextprotected void
initChannel
(io.netty.channel.Channel ch) Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Field Details
-
ORIGIN_NETTY_LOGGER
- See Also:
-
CONNECTION_POOL_HANDLER
- See Also:
-
connectionPoolHandler
-
httpMetricsHandler
-
nettyLogger
protected final io.netty.handler.logging.LoggingHandler nettyLogger
-
-
Constructor Details
-
DefaultOriginChannelInitializer
public DefaultOriginChannelInitializer(ConnectionPoolConfig connPoolConfig, com.netflix.spectator.api.Registry spectatorRegistry)
-
-
Method Details
-
initChannel
- Specified by:
initChannel
in classio.netty.channel.ChannelInitializer<io.netty.channel.Channel>
- Throws:
Exception
-
getClientSslContext
protected io.netty.handler.ssl.SslContext getClientSslContext(com.netflix.spectator.api.Registry spectatorRegistry) This method can be overridden to create your own custom SSL context- Parameters:
spectatorRegistry
- metrics registry- Returns:
- Netty SslContext
-
addMethodBindingHandler
protected void addMethodBindingHandler(io.netty.channel.ChannelPipeline pipeline) This method can be overridden to add your own MethodBinding handler for preserving thread locals or thread variables. This should be a handler that binds downstream channelRead and userEventTriggered with the MethodBinding class. It should be added using the pipeline.addLast method.- Parameters:
pipeline
- the channel pipeline
-
getHttpMetricsHandler
- Specified by:
getHttpMetricsHandler
in classOriginChannelInitializer
-