Package org.apache.camel.component.netty
Interface NettyServerBootstrapFactory
-
- All Superinterfaces:
AutoCloseable,org.apache.camel.Service,org.apache.camel.SuspendableService
- All Known Implementing Classes:
ClientModeTCPNettyServerBootstrapFactory,SingleTCPNettyServerBootstrapFactory,SingleUDPNettyServerBootstrapFactory
public interface NettyServerBootstrapFactory extends org.apache.camel.SuspendableServiceFactory for setting up NettyServerBootstrapand all the needed logic for doing that. This factory allows for consumers to reuse existingServerBootstrapwhich allows to share the same port for multiple consumers.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddChannel(io.netty.channel.Channel channel)When a newChannelis opened.voidaddConsumer(NettyConsumer consumer)When aNettyConsumeris added and uses this bootstrap factory.voidinit(ThreadFactory threadFactory, NettyServerBootstrapConfiguration configuration, io.netty.channel.ChannelInitializer<io.netty.channel.Channel> pipelineFactory)Initializes this sharedNettyServerBootstrapFactory.voidinit(org.apache.camel.CamelContext camelContext, NettyServerBootstrapConfiguration configuration, io.netty.channel.ChannelInitializer<io.netty.channel.Channel> pipelineFactory)Initializes this non-sharedNettyServerBootstrapFactory.voidremoveChannel(io.netty.channel.Channel channel)When aChannelis closed.voidremoveConsumer(NettyConsumer consumer)When aNettyConsumeris removed and no longer using this bootstrap factory.
-
-
-
Method Detail
-
init
void init(org.apache.camel.CamelContext camelContext, NettyServerBootstrapConfiguration configuration, io.netty.channel.ChannelInitializer<io.netty.channel.Channel> pipelineFactory)Initializes this non-sharedNettyServerBootstrapFactory.- Parameters:
camelContext- theCamelContextfor non-shared bootstrap factoryconfiguration- the bootstrap configurationpipelineFactory- the channel initializer which set up the channel handler pipeline
-
init
void init(ThreadFactory threadFactory, NettyServerBootstrapConfiguration configuration, io.netty.channel.ChannelInitializer<io.netty.channel.Channel> pipelineFactory)
Initializes this sharedNettyServerBootstrapFactory.- Parameters:
threadFactory- the thread factory to use for shared bootstrap factoryconfiguration- the bootstrap configurationpipelineFactory- the channel initializer which set up the channel handler pipeline
-
addChannel
void addChannel(io.netty.channel.Channel channel)
When a newChannelis opened.
-
removeChannel
void removeChannel(io.netty.channel.Channel channel)
When aChannelis closed.
-
addConsumer
void addConsumer(NettyConsumer consumer)
When aNettyConsumeris added and uses this bootstrap factory.
-
removeConsumer
void removeConsumer(NettyConsumer consumer)
When aNettyConsumeris removed and no longer using this bootstrap factory.
-
-