Package com.mastfrog.acteur.server
Class ServerModule<A extends Application>
java.lang.Object
com.google.inject.AbstractModule
com.mastfrog.acteur.server.ServerModule<A>
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
GenericApplicationModule
Guice module for creating a server; also defines settings keys which can
affect behavior.
- Author:
- Tim Boudreau
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests.static final StringDeprecated.static final StringProperty name for setting which byte buffer allocator Netty uses (heap, direct, pooled).static final StringProperty value for telling the server to use the pooled byte buffer allocator with custom settings.static final StringThe default allocator to use if none is specifiedstatic final intDefault value for settings keycompression.levelstatic final intDefault value for settings keycompression.memory.levelstatic final intDefault value for settings keycompression.thresholdstatic final intDefault value for settings keycompression.window.bitsstatic final booleanDefault value forstatic final StringDefault value for @link(ServerModule.SETTINGS_KEY_CORS_ALLOW_ORIGIN}.static final booleanDefault value for @link(ServerModule.SETTINGS_KEY_CORS_ENABLED}.static final longDefault value for @link(ServerModule.SETTINGS_KEY_CORS_MAX_AGE_MINUTES}.static final booleanstatic final booleanDefault value for TCP_NODELAY for outbound connections.static final booleanstatic final StringGuice binding for@Named(DELAY_EXECUTOR) ScheduledExecutorServiceto get a scheduled executor service which shares a ThreadFactory with the worker thread pool.static final StringProperty value for telling the server to use the direct byte buffer allocator (non-heap).static final StringProperty value for telling the server to use the heap or direct byte buffer allocator as decided by Netty's PlatformDependent class.static final StringNumber of event threadsstatic final StringGuice #&064;Named binding for objects you want in the context for every request, which can be replaced by ones provided to the context by Acteurs.static final StringProperty value for telling the server to use the heap byte buffer allocator.static final StringSettings key for enabling HTTP compression.static final StringIf true, the response compressor will check the response's Content-Type header and avoid compressing responses with media types that are pre-compressed or liable to be made larger by gzip or deflate compression, such as mpeg or jpeg.static final StringSets the HTTP compression level from 0 to 9, 0 meaning no compression, 9 meaning maximum compression; the default is 6.static final StringSets the amount of memory to use for compression state, from 1 to 9, higher numbers using more memory but getting better and faster compression.static final StringSets the compression threshold for responses which have their Content-Length set - Netty's HttpContentCompressor decides to act before HTTP chunks are seen, so chunked responses will use the default behavior.static final StringSets the size of the history buffer for compression - should be in the range 9 to 15, higher numbers meaning better commpression at the cost of memory.static final StringSettings key for the maximum content length.static final StringProperty value for telling the server to use the pooled byte buffer allocator.static final StringThe port to run onprotected final com.mastfrog.giulius.scope.ReentrantScopestatic final StringName of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests, but wrappered so that all runnables are run within the application's request scope and have whatever context they were submitted with.static final StringName of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests, but wrappered so that all runnables are run within the application's request scope and have whatever context they were submitted with.static final StringThe base path for all URLs in the application, allowing it to be "mounted" on a URL path - so a server such as NginX can reverse proxy it under the path/foo, and that is transparent to application code, and is used when generating redirect URLs.static final StringIf set in settings, only this IP address will be bound when starting the server.static final Stringstatic final StringIf the default support for CORS requests is enabled, this is the value for theAccess-Control-Allow-Credentialsheader.static final StringIf the default support for CORS requests is enabled, or for requests annotated with &064;CORS that do not specify this, this is the value of what hosts the response is valid for (what sites can use scripts from this server without the browser blocking them).static final StringIf the default support for CORS requests is enabled, this is the value of what hosts the response is valid for (what sites can use scripts from this server without the browser blocking them).static final StringIf the default support for CORS requests is enabled, this is the value of what hosts the response is valid for (what sites can use scripts from this server without the browser blocking them).static final StringSettings key if true, do CORS responses on OPTIONS requests.static final StringIf the default support for CORS requests is enabled, this is the max age in minutes that the browser should regard the response as valid.static final StringIf the default support for CORS requests is enabled, use this instead of the default cors allow headers string.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringFine tuning for using customized pooled byte buf allocator.static final StringIf true, the return value of Event.remoteAddress() will prefer the headers X-Forwarded-For or X-Real-IP if present, so that running an acteur application behind a reverse proxy does not mask the actual IP address.static final StringNumber of threads to process delayed responses (see Acteur.setDelay()).static final StringIf set to true (the default), turn off Netty's leak detector.static final StringWhether or not methods on PathFactory which do not take a protocol or secure parameter should generate secure or insecure URLs.static final StringURLs are generated using the host from InetAddress.getLocalHostName().static final StringLength in bytes of the maximum inbound HTTP chunk size, after which the http codec will return a /bad-request response.static final StringLength in bytes of the maximum HTTP header buffer size after which the http codec will return a /bad-request response.static final StringLength in bytes of the maximum request line length, after which the http codec will return a /bad-request response.static final StringRender stack traces into the response if an exception is thrown.static final StringLow level socket option for outbound connections.static final StringLow level socket option for outbound connections.static final StringLow level socket option for outbound connections.static final StringLow level socket option for outbound connections.static final StringLow level socket option for outbound connections.static final StringLow level socket option for outbound connections; default value is true, disabling Nagle's algorithm.static final StringLow level socket option for outbound connections.static final StringIf enabled, serve HTTPS by default.static final StringSettings key for the SSL engine to use - the name of one of the constants on SslProvider.static final StringDetermine if the application should exit if an exception is thrown when binding the server socket (usually because the port is in use).static final StringThe external port if running behind a proxy, for use when PathFactory generates redirect URLs.static final StringThe secure port if running behind a proxy, for use when PathFactory generates redirect URLs.static final StringThe host name to use in URLs generated for redirects and similar, by PathFactory.static final StringIf true (the default), a ForkJoinPool will be used for dispatching work to acteurs; if not, a fixed thread ExecutorService will be used.static final StringIf enabled, turn on websocket support for the server process.static final StringName of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests.static final StringSettings key for the number of worker threads to use.static final io.netty.util.AsciiStringHeader which, when attached to a response, bypasses the compresser - used in an application which supports HTTP compression but which, for some resources, will serve pre-compressed data.static final HeaderValueType<CharSequence>Header which, when attached to a response, bypasses the compresser - used in an application which supports HTTP compression but which, for some resources, will serve pre-compressed data. -
Constructor Summary
ConstructorsConstructorDescriptionServerModule(com.mastfrog.giulius.scope.ReentrantScope scope, Class<? extends A> appType) ServerModule(com.mastfrog.giulius.scope.ReentrantScope scope, Class<? extends A> appType, int workerThreadCount, int eventThreadCount, int backgroundThreadCount) ServerModule(Class<? extends A> appType) ServerModule(Class<? extends A> appType, int workerThreadCount, int eventThreadCount, int backgroundThreadCount) -
Method Summary
Modifier and TypeMethodDescriptionadd(com.google.inject.Module module) Add another module to be installed with this onefinal com.mastfrog.giulius.scope.ReentrantScopeGet the Guice scope used for injecting dynamic request-related objects into Acteur constructors.protected voidprotected io.netty.bootstrap.ServerBootstrapconfigureServerBootstrap(io.netty.bootstrap.ServerBootstrap bootstrap, com.mastfrog.settings.Settings settings) Deprecated.Bind an instance of ServerBootstrapConfigurer insteadprotected voidonAfterStart(com.mastfrog.acteur.util.Server server, com.mastfrog.giulius.Dependencies deps) protected voidonBeforeStart(com.mastfrog.acteur.util.Server server, com.mastfrog.giulius.Dependencies deps) protected voidonInit(com.mastfrog.settings.Settings settings) Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Field Details
-
X_INTERNAL_COMPRESS
public static final io.netty.util.AsciiString X_INTERNAL_COMPRESSHeader which, when attached to a response, bypasses the compresser - used in an application which supports HTTP compression but which, for some resources, will serve pre-compressed data. -
X_INTERNAL_COMPRESS_HEADER
Header which, when attached to a response, bypasses the compresser - used in an application which supports HTTP compression but which, for some resources, will serve pre-compressed data. -
HTTP_COMPRESSION_LEVEL
Sets the HTTP compression level from 0 to 9, 0 meaning no compression, 9 meaning maximum compression; the default is 6.- See Also:
-
HTTP_COMPRESSION_WINDOW_BITS
Sets the size of the history buffer for compression - should be in the range 9 to 15, higher numbers meaning better commpression at the cost of memory.- See Also:
-
HTTP_COMPRESSION_MEMORY_LEVEL
Sets the amount of memory to use for compression state, from 1 to 9, higher numbers using more memory but getting better and faster compression.- See Also:
-
HTTP_COMPRESSION_THRESHOLD
Sets the compression threshold for responses which have their Content-Length set - Netty's HttpContentCompressor decides to act before HTTP chunks are seen, so chunked responses will use the default behavior. If you are sending raw ByteBufs or attaching the bytes inActeur.ok(bytes)orActeur.reply(responseCode, bytes)then this will disable compression for messages smaller than this threshold (for small messages, compression can make them bigger).- See Also:
-
HTTP_COMPRESSION_CHECK_RESPONSE_CONTENT_TYPE
If true, the response compressor will check the response's Content-Type header and avoid compressing responses with media types that are pre-compressed or liable to be made larger by gzip or deflate compression, such as mpeg or jpeg. This is off by default, since it adds a small amount of overhead to each response.- See Also:
-
DEFAULT_COMPRESSION_LEVEL
public static final int DEFAULT_COMPRESSION_LEVELDefault value for settings keycompression.level- See Also:
-
com.mastfrog.acteur.server.ServerModule.HTTP_COMPRESSION_LEVEL- Constant Field Values
-
DEFAULT_COMPRESSION_WINDOW_BITS
public static final int DEFAULT_COMPRESSION_WINDOW_BITSDefault value for settings keycompression.window.bits- See Also:
-
com.mastfrog.acteur.server.ServerModule.HTTP_COMPRESSION_WINDOW_BITS- Constant Field Values
-
DEFAULT_COMPRESSION_MEMORY_LEVEL
public static final int DEFAULT_COMPRESSION_MEMORY_LEVELDefault value for settings keycompression.memory.level- See Also:
-
com.mastfrog.acteur.server.ServerModule.HTTP_COMPRESSION_MEMORY_LEVEL- Constant Field Values
-
DEFAULT_COMPRESSION_THRESHOLD
public static final int DEFAULT_COMPRESSION_THRESHOLDDefault value for settings keycompression.threshold- See Also:
-
com.mastfrog.acteur.server.ServerModule.HTTP_THRESHOLD- Constant Field Values
-
SETTINGS_KEY_BIND_ADDRESS
If set in settings, only this IP address will be bound when starting the server.- See Also:
-
SETTINGS_KEY_BASE_PATH
The base path for all URLs in the application, allowing it to be "mounted" on a URL path - so a server such as NginX can reverse proxy it under the path/foo, and that is transparent to application code, and is used when generating redirect URLs.- See Also:
-
SETTINGS_KEY_URLS_HOST_NAME
The host name to use in URLs generated for redirects and similar, by PathFactory.- See Also:
-
SETTINGS_KEY_URLS_EXTERNAL_PORT
The external port if running behind a proxy, for use when PathFactory generates redirect URLs.- See Also:
-
SETTINGS_KEY_URLS_EXTERNAL_SECURE_PORT
The secure port if running behind a proxy, for use when PathFactory generates redirect URLs.- See Also:
-
SETTINGS_KEY_GENERATE_SECURE_URLS
Whether or not methods on PathFactory which do not take a protocol or secure parameter should generate secure or insecure URLs.- See Also:
-
SETTINGS_KEY_DISABLE_LEAK_DETECTOR
If set to true (the default), turn off Netty's leak detector.- See Also:
-
DEFAULT_DISABLE_LEAK_DETECTOR
public static final boolean DEFAULT_DISABLE_LEAK_DETECTOR- See Also:
-
SETTINGS_KEY_RENDER_STACK_TRACES
Render stack traces into the response if an exception is thrown. Defaults to true. Defaults to true unless Guice's stage is production, but can be overridden with this property.- See Also:
-
SETTINGS_KEY_GENERATE_URLS_WITH_INET_ADDRESS_GET_LOCALHOST
URLs are generated using the host from InetAddress.getLocalHostName(). Note that the result of this may be quite unpredictable.- See Also:
-
BACKGROUND_THREAD_POOL_NAME
Name of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests.- See Also:
-
WORKER_THREAD_POOL_NAME
Name of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests.- See Also:
-
SCOPED_WORKER_THREAD_POOL_NAME
Name of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests, but wrappered so that all runnables are run within the application's request scope and have whatever context they were submitted with.- See Also:
-
SCOPED_BACKGROUND_THREAD_POOL_NAME
Name of the @Named parameter that should be used in an annotation if you want Guice to inject the specific thread pool used for processing requests, but wrappered so that all runnables are run within the application's request scope and have whatever context they were submitted with.- See Also:
-
BYTEBUF_ALLOCATOR_SETTINGS_KEY
Property name for setting which byte buffer allocator Netty uses (heap, direct, pooled).- See Also:
-
DIRECT_ALLOCATOR
Property value for telling the server to use the direct byte buffer allocator (non-heap).- See Also:
-
HEAP_ALLOCATOR
Property value for telling the server to use the heap byte buffer allocator.- See Also:
-
POOLED_ALLOCATOR
Property value for telling the server to use the pooled byte buffer allocator.- See Also:
-
CUSTOMIZED_POOLED_ALLOCATOR
Property value for telling the server to use the pooled byte buffer allocator with custom settings.- See Also:
-
DIRECT_OR_HEAP_BY_PLATFORM
Property value for telling the server to use the heap or direct byte buffer allocator as decided by Netty's PlatformDependent class.- See Also:
-
DEFAULT_ALLOCATOR
The default allocator to use if none is specified- See Also:
-
WORKER_THREADS
Settings key for the number of worker threads to use.- See Also:
-
EVENT_THREADS
Number of event threads- See Also:
-
BACKGROUND_THREADS
Deprecated.Number of background thread pool threads. The background thread pool is used by a few things which chunk responses.- See Also:
-
PORT
The port to run on- See Also:
-
HTTP_COMPRESSION
Settings key for enabling HTTP compression.- See Also:
-
MAX_CONTENT_LENGTH
Settings key for the maximum content length.- See Also:
-
DELAY_EXECUTOR
Guice binding for@Named(DELAY_EXECUTOR) ScheduledExecutorServiceto get a scheduled executor service which shares a ThreadFactory with the worker thread pool.- See Also:
-
SETTINGS_KEY_DELAY_THREAD_POOL_THREADS
Number of threads to process delayed responses (see Acteur.setDelay()). These threads are typically not busy and can be 1-2 threads.- See Also:
-
SETTINGS_KEY_DECODE_REAL_IP
If true, the return value of Event.remoteAddress() will prefer the headers X-Forwarded-For or X-Real-IP if present, so that running an acteur application behind a reverse proxy does not mask the actual IP address.- See Also:
-
SETTINGS_KEY_CORS_ENABLED
Settings key if true, do CORS responses on OPTIONS requests.- See Also:
-
SETTINGS_KEY_USE_FORK_JOIN_POOL
If true (the default), a ForkJoinPool will be used for dispatching work to acteurs; if not, a fixed thread ExecutorService will be used. The default is correct for most appliations; applications which require an extremely small memory footprint (7-10Mb) will reduce their memory requirements under load by turning this off.- See Also:
-
SETTINGS_KEY_CORS_MAX_AGE_MINUTES
If the default support for CORS requests is enabled, this is the max age in minutes that the browser should regard the response as valid.- See Also:
-
GUICE_BINDING_DEFAULT_CONTEXT_OBJECTS
Guice #&064;Named binding for objects you want in the context for every request, which can be replaced by ones provided to the context by Acteurs. This allows you to have always-there default instances of things, which can be replaced by ones customized by acteurs that handle the request. Example: A default mongodb cursor control object which specifies timeout, and which can be copied and customized.- See Also:
-
SETTINGS_KEY_CORS_ALLOW_ORIGIN
If the default support for CORS requests is enabled, this is the value of what hosts the response is valid for (what sites can use scripts from this server without the browser blocking them). The default is *.- See Also:
-
SETTINGS_KEY_CORS_ALLOW_HEADERS
If the default support for CORS requests is enabled, or for requests annotated with &064;CORS that do not specify this, this is the value of what hosts the response is valid for (what sites can use scripts from this server without the browser blocking them). The default is *.- See Also:
-
SETTINGS_KEY_CORS_REPLACE_ALLOW_HEADERS
If the default support for CORS requests is enabled, use this instead of the default cors allow headers string.- See Also:
-
SETTINGS_KEY_CORS_ALLOW_CREDENTIALS
If the default support for CORS requests is enabled, this is the value for theAccess-Control-Allow-Credentialsheader.- See Also:
-
SETTINGS_KEY_CORS_CACHE_CONTROL_MAX_AGE
If the default support for CORS requests is enabled, this is the value of what hosts the response is valid for (what sites can use scripts from this server without the browser blocking them). The default is *.- See Also:
-
DEFAULT_CORS_ENABLED
public static final boolean DEFAULT_CORS_ENABLEDDefault value for @link(ServerModule.SETTINGS_KEY_CORS_ENABLED}.- See Also:
-
DEFAULT_CORS_MAX_AGE_MINUTES
public static final long DEFAULT_CORS_MAX_AGE_MINUTESDefault value for @link(ServerModule.SETTINGS_KEY_CORS_MAX_AGE_MINUTES}.- See Also:
-
DEFAULT_CORS_ALLOW_CREDENTIALS
public static final boolean DEFAULT_CORS_ALLOW_CREDENTIALSDefault value for- See Also:
-
DEFAULT_CORS_ALLOW_ORIGIN
Default value for @link(ServerModule.SETTINGS_KEY_CORS_ALLOW_ORIGIN}.- See Also:
-
SETTINGS_KEY_SSL_ENGINE
Settings key for the SSL engine to use - the name of one of the constants on SslProvider.- See Also:
-
SETTINGS_KEY_SYSTEM_EXIT_ON_BIND_FAILURE
Determine if the application should exit if an exception is thrown when binding the server socket (usually because the port is in use). The default is true, but in cases where multiple servers are started in one JVM and the failure of one should not cause the JVM to exit, it can be set to false and the JVM will continue running if there are any live non-daemon threads.- See Also:
-
SETTINGS_KEY_SSL_ENABLED
If enabled, serve HTTPS by default.- See Also:
-
SETTINGS_KEY_WEBSOCKETS_ENABLED
If enabled, turn on websocket support for the server process.- See Also:
-
SETTINGS_KEY_SOCKET_TCP_NODELAY
Low level socket option for outbound connections; default value is true, disabling Nagle's algorithm.- See Also:
-
SETTINGS_KEY_SOCKET_CONNECT_TIMEOUT_MILLIS
Low level socket option for outbound connections.- See Also:
-
SETTINGS_KEY_SOCKET_MAX_MESSAGES_PER_READ
Low level socket option for outbound connections.- See Also:
-
SETTINGS_KEY_SOCKET_MAX_MESSAGES_PER_INDIVIDUAL_READ
Low level socket option for outbound connections.- See Also:
-
SETTINGS_KEY_SOCKET_SO_RCVBUF
Low level socket option for outbound connections.- See Also:
-
SETTINGS_KEY_SOCKET_SO_SNDBUF
Low level socket option for outbound connections.- See Also:
-
SETTINGS_KEY_SOCKET_WRITE_SPIN_COUNT
Low level socket option for outbound connections.- See Also:
-
DEFAULT_TCP_NODELAY
public static final boolean DEFAULT_TCP_NODELAYDefault value for TCP_NODELAY for outbound connections.- See Also:
-
DEFAULT_WEBSOCKET_ENABLED
public static final boolean DEFAULT_WEBSOCKET_ENABLED- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_CACHE_ALIGNMENT
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_USE_CACHE_ALL_THREADS
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_NORMAL_CACHE_SIZE
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_SMALL_CACHE_SIZE
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_TINY_CACHE_SIZE
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_MAX_ORDER
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_PAGE_SIZE
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_NUM_DIRECT_ARENAS
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_NUM_HEAP_ARENAS
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_CUSTOM_ALLOC_PREFER_DIRECT
Fine tuning for using customized pooled byte buf allocator. Only relevant if you set BYTEBUF_ALLOCATOR_SETTINGS_KEY=CUSTOMIZED_POOLED_ALLOCATOR in settings (e.g.acteur.bytebuf.allocator=pooled-custom). See the javadoc for PooledByteBufAllocator.- See Also:
-
SETTINGS_KEY_MAX_REQUEST_LINE_LENGTH
Length in bytes of the maximum request line length, after which the http codec will return a /bad-request response.- See Also:
-
SETTINGS_KEY_MAX_HEADER_BUFFER_SIZE
Length in bytes of the maximum HTTP header buffer size after which the http codec will return a /bad-request response.- See Also:
-
SETTINGS_KEY_MAX_CHUNK_SIZE
Length in bytes of the maximum inbound HTTP chunk size, after which the http codec will return a /bad-request response.- See Also:
-
SETTINGS_KEY_CHARSET
- See Also:
-
appType
-
scope
protected final com.mastfrog.giulius.scope.ReentrantScope scope
-
-
Constructor Details
-
ServerModule
-
ServerModule
-
ServerModule
-
ServerModule
-
-
Method Details
-
applicationScope
public final com.mastfrog.giulius.scope.ReentrantScope applicationScope()Get the Guice scope used for injecting dynamic request-related objects into Acteur constructors.- Returns:
- The scope
-
configure
protected void configure()- Overrides:
configurein classcom.google.inject.AbstractModule
-
add
Add another module to be installed with this one- Parameters:
module-
-
configureServerBootstrap
@Deprecated protected io.netty.bootstrap.ServerBootstrap configureServerBootstrap(io.netty.bootstrap.ServerBootstrap bootstrap, com.mastfrog.settings.Settings settings) Deprecated.Bind an instance of ServerBootstrapConfigurer insteadOverride to configure options on the bootstrap which will start the server. The default implementation sets up the allocator.- Parameters:
bootstrap- The server bootstrapsettings- The application settings- Returns:
- The same bootstrap or optionally another one
-
onInit
protected void onInit(com.mastfrog.settings.Settings settings) -
onBeforeStart
protected void onBeforeStart(com.mastfrog.acteur.util.Server server, com.mastfrog.giulius.Dependencies deps) -
onAfterStart
protected void onAfterStart(com.mastfrog.acteur.util.Server server, com.mastfrog.giulius.Dependencies deps)
-