Class DefaultNettySharedHttpServer
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.netty.http.DefaultNettySharedHttpServer
- All Implemented Interfaces:
AutoCloseable,NettySharedHttpServer,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.StatefulService,org.apache.camel.SuspendableService
public class DefaultNettySharedHttpServer
extends org.apache.camel.support.service.ServiceSupport
implements NettySharedHttpServer
A default
NettySharedHttpServer to make sharing Netty server in Camel applications easier.-
Field Summary
FieldsFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected voiddoStop()Gets theHttpServerConsumerChannelFactoryto use.intNumber of consumers using this shared Netty HTTP server.intgetPort()Gets the port number this Netty HTTP server uses.org.apache.camel.component.netty.NettyServerBootstrapFactoryGets theNettyServerBootstrapFactoryto use.voidsetCamelContext(org.apache.camel.CamelContext camelContext) The CamelContextvoidSets the bootstrap configuration to use by this shared Netty HTTP server.voidsetStartServer(boolean startServer) Whether to start the Netty HTTP server eager and bind to the port, or wait on first demandvoidsetThreadNamePattern(String pattern) Sets a custom thread name pattern to be used for naming the Netty HTTP server threads.Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Field Details
-
DEFAULT_PATTERN
- See Also:
-
-
Constructor Details
-
DefaultNettySharedHttpServer
public DefaultNettySharedHttpServer()
-
-
Method Details
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) Description copied from interface:NettySharedHttpServerThe CamelContext- Specified by:
setCamelContextin interfaceNettySharedHttpServer
-
getPort
public int getPort()Description copied from interface:NettySharedHttpServerGets the port number this Netty HTTP server uses.- Specified by:
getPortin interfaceNettySharedHttpServer
-
getConsumerChannelFactory
Description copied from interface:NettySharedHttpServerGets theHttpServerConsumerChannelFactoryto use.- Specified by:
getConsumerChannelFactoryin interfaceNettySharedHttpServer
-
getServerBootstrapFactory
public org.apache.camel.component.netty.NettyServerBootstrapFactory getServerBootstrapFactory()Description copied from interface:NettySharedHttpServerGets theNettyServerBootstrapFactoryto use.- Specified by:
getServerBootstrapFactoryin interfaceNettySharedHttpServer
-
getConsumersSize
public int getConsumersSize()Description copied from interface:NettySharedHttpServerNumber of consumers using this shared Netty HTTP server.- Specified by:
getConsumersSizein interfaceNettySharedHttpServer
-
setStartServer
public void setStartServer(boolean startServer) Description copied from interface:NettySharedHttpServerWhether to start the Netty HTTP server eager and bind to the port, or wait on first demand- Specified by:
setStartServerin interfaceNettySharedHttpServer
-
setThreadNamePattern
Description copied from interface:NettySharedHttpServerSets a custom thread name pattern to be used for naming the Netty HTTP server threads.- Specified by:
setThreadNamePatternin interfaceNettySharedHttpServer
-
doStart
- Overrides:
doStartin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
doStop
protected void doStop()- Overrides:
doStopin classorg.apache.camel.support.service.BaseService