org.apache.camel.component.netty.http
Class DefaultNettySharedHttpServer

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.component.netty.http.DefaultNettySharedHttpServer
All Implemented Interfaces:
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.ServiceSupport
implements NettySharedHttpServer

A default NettySharedHttpServer to make sharing Netty server in Camel applications easier.


Field Summary
static String DEFAULT_PATTERN
           
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
DefaultNettySharedHttpServer()
           
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 HttpServerConsumerChannelFactory getConsumerChannelFactory()
          Gets the HttpServerConsumerChannelFactory 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 the NettyServerBootstrapFactory to use.
 void setClassResolver(org.apache.camel.spi.ClassResolver classResolver)
          To use a custom ClassResolver for loading resource on the classpath.
 void 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 demand
 void 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.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Field Detail

DEFAULT_PATTERN

public static final String DEFAULT_PATTERN
See Also:
Constant Field Values
Constructor Detail

DefaultNettySharedHttpServer

public DefaultNettySharedHttpServer()
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 interface NettySharedHttpServer

setClassResolver

public void setClassResolver(org.apache.camel.spi.ClassResolver classResolver)
Description copied from interface: NettySharedHttpServer
To use a custom ClassResolver for loading resource on the classpath.

Specified by:
setClassResolver in interface NettySharedHttpServer

getPort

public int getPort()
Description copied from interface: NettySharedHttpServer
Gets the port number this Netty HTTP server uses.

Specified by:
getPort in interface NettySharedHttpServer

getConsumerChannelFactory

public HttpServerConsumerChannelFactory getConsumerChannelFactory()
Description copied from interface: NettySharedHttpServer
Gets the HttpServerConsumerChannelFactory to use.

Specified by:
getConsumerChannelFactory in interface NettySharedHttpServer

getServerBootstrapFactory

public org.apache.camel.component.netty.NettyServerBootstrapFactory getServerBootstrapFactory()
Description copied from interface: NettySharedHttpServer
Gets the NettyServerBootstrapFactory to use.

Specified by:
getServerBootstrapFactory in interface NettySharedHttpServer

getConsumersSize

public int getConsumersSize()
Description copied from interface: NettySharedHttpServer
Number of consumers using this shared Netty HTTP server.

Specified by:
getConsumersSize in interface NettySharedHttpServer

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 interface NettySharedHttpServer

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 interface NettySharedHttpServer

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class org.apache.camel.support.ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class org.apache.camel.support.ServiceSupport
Throws:
Exception


Apache Camel