Class ServerBootstrap
- java.lang.Object
-
- org.apache.http.impl.nio.bootstrap.ServerBootstrap
-
public class ServerBootstrap extends java.lang.Object
- Since:
- 4.4
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerBootstrap
addInterceptorFirst(org.apache.http.HttpRequestInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.ServerBootstrap
addInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.ServerBootstrap
addInterceptorLast(org.apache.http.HttpRequestInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.ServerBootstrap
addInterceptorLast(org.apache.http.HttpResponseInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.static ServerBootstrap
bootstrap()
HttpServer
create()
ServerBootstrap
registerHandler(java.lang.String pattern, HttpAsyncRequestHandler<?> handler)
Registers the givenHttpAsyncRequestHandler
as a handler for URIs matching the given pattern.ServerBootstrap
setConnectionConfig(org.apache.http.config.ConnectionConfig connectionConfig)
Sets connection configuration.ServerBootstrap
setConnectionFactory(NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory)
AssignsNHttpConnectionFactory
instance.ServerBootstrap
setConnectionReuseStrategy(org.apache.http.ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategy
instance.ServerBootstrap
setExceptionLogger(org.apache.http.ExceptionLogger exceptionLogger)
AssignsExceptionLogger
instance.ServerBootstrap
setExpectationVerifier(HttpAsyncExpectationVerifier expectationVerifier)
AssignsHttpAsyncExpectationVerifier
instance.ServerBootstrap
setHandlerMapper(HttpAsyncRequestHandlerMapper handlerMapper)
AssignsHttpAsyncRequestHandlerMapper
instance.ServerBootstrap
setHttpProcessor(org.apache.http.protocol.HttpProcessor httpProcessor)
AssignsHttpProcessor
instance.ServerBootstrap
setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.ServerBootstrap
setListenerPort(int listenerPort)
Sets listener port number.ServerBootstrap
setLocalAddress(java.net.InetAddress localAddress)
Assigns local interface for the listener.ServerBootstrap
setResponseFactory(org.apache.http.HttpResponseFactory responseFactory)
AssignsHttpResponseFactory
instance.ServerBootstrap
setServerInfo(java.lang.String serverInfo)
AssignsServer
response header value.ServerBootstrap
setSslContext(javax.net.ssl.SSLContext sslContext)
AssignsSSLContext
instance.ServerBootstrap
setSslSetupHandler(SSLSetupHandler sslSetupHandler)
AssignsSSLSetupHandler
instance.
-
-
-
Method Detail
-
bootstrap
public static ServerBootstrap bootstrap()
-
setListenerPort
public final ServerBootstrap setListenerPort(int listenerPort)
Sets listener port number.
-
setLocalAddress
public final ServerBootstrap setLocalAddress(java.net.InetAddress localAddress)
Assigns local interface for the listener.
-
setIOReactorConfig
public final ServerBootstrap setIOReactorConfig(IOReactorConfig ioReactorConfig)
Sets I/O reactor configuration.
-
setConnectionConfig
public final ServerBootstrap setConnectionConfig(org.apache.http.config.ConnectionConfig connectionConfig)
Sets connection configuration.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.nio.NHttpConnectionFactory)
method.
-
setHttpProcessor
public final ServerBootstrap setHttpProcessor(org.apache.http.protocol.HttpProcessor httpProcessor)
AssignsHttpProcessor
instance.
-
addInterceptorFirst
public final ServerBootstrap addInterceptorFirst(org.apache.http.HttpResponseInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)
method.
-
addInterceptorLast
public final ServerBootstrap addInterceptorLast(org.apache.http.HttpResponseInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)
method.
-
addInterceptorFirst
public final ServerBootstrap addInterceptorFirst(org.apache.http.HttpRequestInterceptor itcp)
Adds this protocol interceptor to the head of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)
method.
-
addInterceptorLast
public final ServerBootstrap addInterceptorLast(org.apache.http.HttpRequestInterceptor itcp)
Adds this protocol interceptor to the tail of the protocol processing list.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)
method.
-
setServerInfo
public final ServerBootstrap setServerInfo(java.lang.String serverInfo)
AssignsServer
response header value.Please note this value can be overridden by the
setHttpProcessor( org.apache.http.protocol.HttpProcessor)
method.
-
setConnectionReuseStrategy
public final ServerBootstrap setConnectionReuseStrategy(org.apache.http.ConnectionReuseStrategy connStrategy)
AssignsConnectionReuseStrategy
instance.
-
setResponseFactory
public final ServerBootstrap setResponseFactory(org.apache.http.HttpResponseFactory responseFactory)
AssignsHttpResponseFactory
instance.
-
setHandlerMapper
public final ServerBootstrap setHandlerMapper(HttpAsyncRequestHandlerMapper handlerMapper)
AssignsHttpAsyncRequestHandlerMapper
instance.
-
registerHandler
public final ServerBootstrap registerHandler(java.lang.String pattern, HttpAsyncRequestHandler<?> handler)
Registers the givenHttpAsyncRequestHandler
as a handler for URIs matching the given pattern.Please note this value can be overridden by the
setHandlerMapper( org.apache.http.nio.protocol.HttpAsyncRequestHandlerMapper)
)} method.- Parameters:
pattern
- the pattern to register the handler for.handler
- the handler.
-
setExpectationVerifier
public final ServerBootstrap setExpectationVerifier(HttpAsyncExpectationVerifier expectationVerifier)
AssignsHttpAsyncExpectationVerifier
instance.
-
setConnectionFactory
public final ServerBootstrap setConnectionFactory(NHttpConnectionFactory<? extends DefaultNHttpServerConnection> connectionFactory)
AssignsNHttpConnectionFactory
instance.
-
setSslContext
public final ServerBootstrap setSslContext(javax.net.ssl.SSLContext sslContext)
AssignsSSLContext
instance.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.nio.NHttpConnectionFactory)
method.
-
setSslSetupHandler
public ServerBootstrap setSslSetupHandler(SSLSetupHandler sslSetupHandler)
AssignsSSLSetupHandler
instance.Please note this value can be overridden by the
setConnectionFactory( org.apache.http.nio.NHttpConnectionFactory)
method.
-
setExceptionLogger
public final ServerBootstrap setExceptionLogger(org.apache.http.ExceptionLogger exceptionLogger)
AssignsExceptionLogger
instance.
-
create
public HttpServer create()
-
-