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 defaultNettySharedHttpServer
to make sharing Netty server in Camel applications easier.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_PATTERN
-
Constructor Summary
Constructors Constructor Description DefaultNettySharedHttpServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
protected void
doStop()
HttpServerConsumerChannelFactory
getConsumerChannelFactory()
Gets theHttpServerConsumerChannelFactory
to use.int
getConsumersSize()
Number of consumers using this shared Netty HTTP server.int
getPort()
Gets the port number this Netty HTTP server uses.org.apache.camel.component.netty.NettyServerBootstrapFactory
getServerBootstrapFactory()
Gets theNettyServerBootstrapFactory
to use.void
setCamelContext(org.apache.camel.CamelContext camelContext)
The CamelContextvoid
setNettyServerBootstrapConfiguration(NettySharedHttpServerBootstrapConfiguration configuration)
Sets the bootstrap configuration to use by this shared Netty HTTP server.void
setStartServer(boolean startServer)
Whether to start the Netty HTTP server eager and bind to the port, or wait on first demandvoid
setThreadNamePattern(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, 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
-
-
-
-
Field Detail
-
DEFAULT_PATTERN
public static final String DEFAULT_PATTERN
- See Also:
- Constant Field Values
-
-
Method Detail
-
setNettyServerBootstrapConfiguration
public void setNettyServerBootstrapConfiguration(NettySharedHttpServerBootstrapConfiguration configuration)
Description copied from interface:NettySharedHttpServer
Sets the bootstrap configuration to use by this shared Netty HTTP server.- Specified by:
setNettyServerBootstrapConfiguration
in interfaceNettySharedHttpServer
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
Description copied from interface:NettySharedHttpServer
The CamelContext- Specified by:
setCamelContext
in interfaceNettySharedHttpServer
-
getPort
public int getPort()
Description copied from interface:NettySharedHttpServer
Gets the port number this Netty HTTP server uses.- Specified by:
getPort
in interfaceNettySharedHttpServer
-
getConsumerChannelFactory
public HttpServerConsumerChannelFactory getConsumerChannelFactory()
Description copied from interface:NettySharedHttpServer
Gets theHttpServerConsumerChannelFactory
to use.- Specified by:
getConsumerChannelFactory
in interfaceNettySharedHttpServer
-
getServerBootstrapFactory
public org.apache.camel.component.netty.NettyServerBootstrapFactory getServerBootstrapFactory()
Description copied from interface:NettySharedHttpServer
Gets theNettyServerBootstrapFactory
to use.- Specified by:
getServerBootstrapFactory
in interfaceNettySharedHttpServer
-
getConsumersSize
public int getConsumersSize()
Description copied from interface:NettySharedHttpServer
Number of consumers using this shared Netty HTTP server.- Specified by:
getConsumersSize
in interfaceNettySharedHttpServer
-
setStartServer
public void setStartServer(boolean startServer)
Description copied from interface:NettySharedHttpServer
Whether to start the Netty HTTP server eager and bind to the port, or wait on first demand- Specified by:
setStartServer
in interfaceNettySharedHttpServer
-
setThreadNamePattern
public void setThreadNamePattern(String pattern)
Description copied from interface:NettySharedHttpServer
Sets a custom thread name pattern to be used for naming the Netty HTTP server threads.- Specified by:
setThreadNamePattern
in interfaceNettySharedHttpServer
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
-