Package org.apache.camel.component.netty
Class ClientModeTCPNettyServerBootstrapFactory
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.component.netty.ClientModeTCPNettyServerBootstrapFactory
-
- All Implemented Interfaces:
AutoCloseable,NettyServerBootstrapFactory,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public class ClientModeTCPNettyServerBootstrapFactory extends org.apache.camel.support.service.ServiceSupport implements NettyServerBootstrapFactory
ANettyServerBootstrapFactorywhich is used by a single consumer (not shared).
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description ClientModeTCPNettyServerBootstrapFactory()
-
Method Summary
All Methods Instance Methods Concrete 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.protected voiddoReconnectIfNeeded()protected voiddoStart()protected voiddoStop()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.protected io.netty.channel.ChannelopenChannel(io.netty.channel.ChannelFuture channelFuture)voidremoveChannel(io.netty.channel.Channel channel)When aChannelis closed.voidremoveConsumer(NettyConsumer consumer)When aNettyConsumeris removed and no longer using this bootstrap factory.protected voidstartServerBootstrap()protected voidstopServerBootstrap()-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
init
public void init(org.apache.camel.CamelContext camelContext, NettyServerBootstrapConfiguration configuration, io.netty.channel.ChannelInitializer<io.netty.channel.Channel> pipelineFactory)Description copied from interface:NettyServerBootstrapFactoryInitializes this non-sharedNettyServerBootstrapFactory.- Specified by:
initin interfaceNettyServerBootstrapFactory- Parameters:
camelContext- theCamelContextfor non-shared bootstrap factoryconfiguration- the bootstrap configurationpipelineFactory- the channel initializer which set up the channel handler pipeline
-
init
public void init(ThreadFactory threadFactory, NettyServerBootstrapConfiguration configuration, io.netty.channel.ChannelInitializer<io.netty.channel.Channel> pipelineFactory)
Description copied from interface:NettyServerBootstrapFactoryInitializes this sharedNettyServerBootstrapFactory.- Specified by:
initin interfaceNettyServerBootstrapFactory- 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
public void addChannel(io.netty.channel.Channel channel)
Description copied from interface:NettyServerBootstrapFactoryWhen a newChannelis opened.- Specified by:
addChannelin interfaceNettyServerBootstrapFactory
-
removeChannel
public void removeChannel(io.netty.channel.Channel channel)
Description copied from interface:NettyServerBootstrapFactoryWhen aChannelis closed.- Specified by:
removeChannelin interfaceNettyServerBootstrapFactory
-
addConsumer
public void addConsumer(NettyConsumer consumer)
Description copied from interface:NettyServerBootstrapFactoryWhen aNettyConsumeris added and uses this bootstrap factory.- Specified by:
addConsumerin interfaceNettyServerBootstrapFactory
-
removeConsumer
public void removeConsumer(NettyConsumer consumer)
Description copied from interface:NettyServerBootstrapFactoryWhen aNettyConsumeris removed and no longer using this bootstrap factory.- Specified by:
removeConsumerin interfaceNettyServerBootstrapFactory
-
doStart
protected void doStart() throws Exception- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
protected void doStop() throws Exception- Overrides:
doStopin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
stopServerBootstrap
protected void stopServerBootstrap()
-
-