public static final class Config.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
Config.Builder |
aggregateRequestBodyInMemory(boolean aggregateRequestBodyInMemory)
By default, Nettosphere aggregate the HTTP request's body in memory an invoke an Atmosphere's components with
a single
AtmosphereResource. |
Config.Builder |
binaryWrite(boolean binaryWrite)
Write binary frame when websocket transport is used.
|
Config.Builder |
bossExecutor(java.util.concurrent.ExecutorService bossExecutor)
The Executor to be used in providing (the) I/O boss-thread(s).
|
Config.Builder |
broadcaster(java.lang.Class<? extends org.atmosphere.cpr.Broadcaster> broadcasterClass)
Configure the default
Broadcaster |
Config.Builder |
broadcasterCache(java.lang.Class<? extends org.atmosphere.cpr.BroadcasterCache> broadcasterCache)
Configure the default
BroadcasterCache |
Config.Builder |
broadcasterFactory(org.atmosphere.cpr.BroadcasterFactory broadcasterFactory)
Configure the default
BroadcasterFactory |
Config |
build()
Build an instance of this class.
|
Config.Builder |
channelUpstreamHandler(io.netty.channel.ChannelInboundHandler h)
Add a
ChannelInboundHandler. |
Config.Builder |
configFile(java.lang.String atmosphereDotXmlPath)
The path location of the atmosphere.xml file.
|
Config.Builder |
enabledCipherSuites(java.lang.String[] cipherSuitesToEnable)
Set a String[] of cipher suites to be enabled.
|
Config.Builder |
enablePong(boolean enablePong)
Enable WebSokcet Pong message.
|
Config.Builder |
epoll(boolean epoll)
Use
EpollEventLoopGroup |
Config.Builder |
excludeInterceptor(java.lang.String interceptor)
Exclude an
AtmosphereInterceptor from being added, at startup, by Atmosphere. |
Config.Builder |
host(java.lang.String host)
The server's host
|
Config.Builder |
initParam(java.lang.String name,
java.lang.String value)
Add some init param
|
Config.Builder |
interceptor(org.atmosphere.cpr.AtmosphereInterceptor interceptor)
Add an
AtmosphereInterceptor |
Config.Builder |
ioExceptionHandler(IOExceptionHandler ioExceptionHandler)
Set an
IOExceptionHandler to handle unexpected I/O exception |
Config.Builder |
mappingPath(java.lang.String mappingPath)
Set the mapping path.
|
Config.Builder |
maxChunkContentLength(int maxChunkContentLength)
When
aggregateRequestBodyInMemory is true,the maximum length of the aggregated content. |
Config.Builder |
maxWebSocketFrameSize(int maxWebSocketFrameSize)
Set the maximum WebSocket Frame Size.
|
Config.Builder |
noInternalAlloc(boolean noInternalAlloc)
Proxy
AtmosphereRequest, AtmosphereResource and AtmosphereRequest
with no ops implementations. |
Config.Builder |
port(int port)
The server's port
|
Config.Builder |
resource(java.lang.Class<?> c)
Add an annotated class.
|
Config.Builder |
resource(Handler handler)
Add an
Handler mapped to the default, which is '/*' |
Config.Builder |
resource(java.lang.String path)
Add a path to scan when looking for static resources like javascript file, html, etc.
|
Config.Builder |
resource(java.lang.String path,
org.atmosphere.cpr.AtmosphereHandler c)
Add an
AtmosphereHandler that will be mapped to the specified path |
Config.Builder |
resource(java.lang.String path,
java.lang.Class<?> c)
Add an
AtmosphereHandler or Servlet class |
Config.Builder |
resource(java.lang.String path,
Handler handler)
Add an
Handler that will be mapped to the specified path |
Config.Builder |
resource(java.lang.String path,
javax.servlet.Servlet c)
Add an
Servlet that will be mapped to the specified path |
Config.Builder |
resource(java.lang.String path,
org.atmosphere.websocket.WebSocketHandler c)
Add an
WebSocketHandler that will be mapped to the specified path |
Config.Builder |
scanLibrary(java.lang.String librariesPath)
Set the path to the library when annotation scanning is enabled.
|
Config.Builder |
servletContextAttribute(java.lang.String name,
java.lang.Object value)
Set ServletContext Attribute
|
Config.Builder |
shareHeaders(boolean shareHeaders)
Share underlying headers map with newly created WebSocket.
|
Config.Builder |
socketKeepAlive(boolean socketKeepAlive)
Set Netty's Bootstrap 'child.keepAlive'
|
Config.Builder |
socketNoTcpDelay(boolean socketNoTcpDelay)
Set Netty's Bootstrap 'child.tcpDelay'
|
Config.Builder |
sslContext(io.netty.handler.ssl.SslContext sslContext)
Set the
SslContext |
Config.Builder |
sslContext(javax.net.ssl.SSLContext context)
Set an SSLContext in order enable SSL
|
Config.Builder |
sslContextListener(SSLContextListener listener)
Add a
SSLContextListener |
Config.Builder |
subProtocols(java.lang.String subProtocols)
A coma delimited of allowed WebSocket Sub Protocol (Sec-WebSocket-Protocol)
|
Config.Builder |
supportChunking(boolean supportChunking)
Set to false to override the default behavior when writing bytes, which is use chunking.
|
Config.Builder |
textFrameAsBinary(boolean textFrameAsBinary)
Do not decode
TextWebSocketFrame into a String and instead pass
it to the WebSocketProcessor as binary. |
Config.Builder |
webSocketOnly(boolean webSocketOnly)
Only Support WebSocket.
|
Config.Builder |
webSocketProtocol(java.lang.Class<? extends org.atmosphere.websocket.WebSocketProtocol> webSocketProtocol)
Configure the default
WebSocketProtocol |
Config.Builder |
workerExecutor(java.util.concurrent.ExecutorService workerExecutor)
The Executor to be used in providing (the) I/O worker-thread(s).
|
public Config.Builder shareHeaders(boolean shareHeaders)
noInternalAlloc is set to true.
Default is falseshareHeaders - public Config.Builder sslContext(javax.net.ssl.SSLContext context)
context - public Config.Builder enabledCipherSuites(java.lang.String[] cipherSuitesToEnable)
String-array - of cipher suites to be enabled.public Config.Builder sslContext(io.netty.handler.ssl.SslContext sslContext)
SslContextsslContext - public Config.Builder maxWebSocketFrameSize(int maxWebSocketFrameSize)
maxWebSocketFrameSize - the maximum WebSocket Frame Size.public Config.Builder sslContextListener(SSLContextListener listener)
SSLContextListenerlistener - public Config.Builder mappingPath(java.lang.String mappingPath)
mappingPath - the path under which the application will be mapped.public Config.Builder enablePong(boolean enablePong)
enablePong - Enable WebSokcet Pong messagepublic Config.Builder maxChunkContentLength(int maxChunkContentLength)
aggregateRequestBodyInMemory is true,the maximum length of the aggregated content.
If the length of the aggregated content exceeds this value,
a TooLongFrameException will be raised.public Config.Builder scanLibrary(java.lang.String librariesPath)
librariesPath - the path to the library when annotation scanning is enabled.public Config.Builder configFile(java.lang.String atmosphereDotXmlPath)
atmosphereDotXmlPath - path location of the atmosphere.xml file.public Config.Builder bossExecutor(java.util.concurrent.ExecutorService bossExecutor)
bossExecutor - ExecutorService to be used for boss threads.public Config.Builder workerExecutor(java.util.concurrent.ExecutorService workerExecutor)
workerExecutor - ExecutorService to be used for worker threads.public Config.Builder host(java.lang.String host)
host - server's hostpublic Config.Builder port(int port)
port - server's portpublic Config.Builder initParam(java.lang.String name, java.lang.String value)
name - the namevalue - the valuepublic Config.Builder resource(java.lang.String path)
path - public Config.Builder resource(java.lang.String path, org.atmosphere.cpr.AtmosphereHandler c)
AtmosphereHandler that will be mapped to the specified pathpath - a mapping pathc - an AtmosphereHandlerpublic Config.Builder resource(java.lang.String path, org.atmosphere.websocket.WebSocketHandler c)
WebSocketHandler that will be mapped to the specified pathpath - a mapping pathc - an AtmosphereHandlerpublic Config.Builder resource(java.lang.String path, javax.servlet.Servlet c)
Servlet that will be mapped to the specified pathpath - a mapping pathc - an Servletpublic Config.Builder resource(Handler handler)
Handler mapped to the default, which is '/*'handler - Handlerpublic Config.Builder resource(java.lang.String path, Handler handler)
Handler that will be mapped to the specified pathhandler - Handlerpublic Config.Builder resource(java.lang.Class<?> c)
c - an annotated class. The annotation can be from Atmosphere or Jersey.public Config.Builder resource(java.lang.String path, java.lang.Class<?> c)
AtmosphereHandler or Servlet classpath - a mapping pathc - an AtmosphereHandler or Servlet classpublic Config.Builder broadcaster(java.lang.Class<? extends org.atmosphere.cpr.Broadcaster> broadcasterClass)
BroadcasterbroadcasterClass - a Broadcasterpublic Config.Builder broadcasterFactory(org.atmosphere.cpr.BroadcasterFactory broadcasterFactory)
BroadcasterFactorybroadcasterFactory - a BroadcasterFactory's classpublic Config.Builder broadcasterCache(java.lang.Class<? extends org.atmosphere.cpr.BroadcasterCache> broadcasterCache)
BroadcasterCachebroadcasterCache - a BroadcasterCache's classpublic Config.Builder webSocketProtocol(java.lang.Class<? extends org.atmosphere.websocket.WebSocketProtocol> webSocketProtocol)
WebSocketProtocolwebSocketProtocol - a WebSocketProtocol's classpublic Config.Builder interceptor(org.atmosphere.cpr.AtmosphereInterceptor interceptor)
AtmosphereInterceptorinterceptor - an AtmosphereInterceptorpublic Config.Builder excludeInterceptor(java.lang.String interceptor)
AtmosphereInterceptor from being added, at startup, by Atmosphere. The default's AtmosphereInterceptor
are candidates for being excludedinterceptor - an AtmosphereInterceptorpublic Config.Builder channelUpstreamHandler(io.netty.channel.ChannelInboundHandler h)
ChannelInboundHandler. All will be executed before BridgeRuntimeh - ChannelInboundHandlerpublic Config.Builder supportChunking(boolean supportChunking)
ChunkedWriteHandler will not be added to the Netty's ChannelPipeline
This is strongly recommended to turn chunking to false if you are using websocket to get better performance.supportChunking - false to disable.public Config.Builder aggregateRequestBodyInMemory(boolean aggregateRequestBodyInMemory)
AtmosphereResource. Setting supportChunkAggregator to false will instead invoke Atmosphere's component
with a new AtmosphereResource each time the request's body is read in memory. Setting to false
may significantly increase the performance and reduce memory footprint. Note that setting this value to false
may deliver to your Atmosphere's component partial body, so your application must make sure to aggregate the
body before parsing the data if needed. For example, if you are using JSON as format, make sure you parse the
data incrementally.aggregateRequestBodyInMemory - false to disable.public Config.Builder socketNoTcpDelay(boolean socketNoTcpDelay)
socketNoTcpDelay - public Config.Builder socketKeepAlive(boolean socketKeepAlive)
socketKeepAlive - public Config.Builder textFrameAsBinary(boolean textFrameAsBinary)
TextWebSocketFrame into a String and instead pass
it to the WebSocketProcessor as binary.textFrameAsBinary - public Config.Builder subProtocols(java.lang.String subProtocols)
subProtocols - A coma delimited of allowed WebSocket Sub Protocolpublic Config.Builder noInternalAlloc(boolean noInternalAlloc)
AtmosphereRequest, AtmosphereResource and AtmosphereRequest
with no ops implementations.
Set it to true only if you are using WebSocket with a your own implementation of WebSocketProcessor. The WebSocketProcessor MUST not invoked those objects and only use the WebSocket API.
Default is falsenoInternalAlloc - public Config.Builder binaryWrite(boolean binaryWrite)
binaryWrite - true or falsepublic Config.Builder webSocketOnly(boolean webSocketOnly)
webSocketOnly - true if only the websocket protocol needs to be suppored.public Config.Builder ioExceptionHandler(IOExceptionHandler ioExceptionHandler)
IOExceptionHandler to handle unexpected I/O exceptionioExceptionHandler - public Config build()
public Config.Builder servletContextAttribute(java.lang.String name, java.lang.Object value)
name - value - public Config.Builder epoll(boolean epoll)
EpollEventLoopGroupCopyright © 2018. All Rights Reserved.