public interface LaunchConfig
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_COMPRESSION_MIN_SIZE
The default compression minimum size in bytes, 1024L.
|
static int |
DEFAULT_MAX_CONTENT_LENGTH
The default max content length.
|
static int |
DEFAULT_PORT
The default port for Ratpack applications, 5050.
|
static int |
DEFAULT_THREADS
The default number of threads an application should use.
|
Modifier and Type | Method and Description |
---|---|
InetAddress |
getAddress()
The address of the interface that the application should bind to.
|
FileSystemBinding |
getBaseDir()
The base dir of the application, which is also the initial
FileSystemBinding . |
ByteBufAllocator |
getBufferAllocator()
The allocator for buffers needed by the application.
|
ImmutableSet<String> |
getCompressionMimeTypeBlackList()
The response mime types which should not be compressed.
|
ImmutableSet<String> |
getCompressionMimeTypeWhiteList()
The response mime types which should be compressed.
|
long |
getCompressionMinSize()
The minimum size at which responses should be compressed, in bytes.
|
ExecController |
getExecController()
The execution controller.
|
HandlerFactory |
getHandlerFactory()
The handler factory that can create the root handler for the application.
|
List<String> |
getIndexFiles()
The names of files that can be served if a request is made to serve a directory.
|
int |
getMaxContentLength()
The max content length to use for the HttpObjectAggregator.
|
String |
getOther(String key,
String defaultValue)
Provides access to any "other" properties that were specified.
|
Map<String,String> |
getOtherPrefixedWith(String prefix)
Provides access to all "other" properties whose name starts with a given prefix.
|
int |
getPort()
The port that the application should listen to requests on.
|
URI |
getPublicAddress()
The public address of the site used for redirects.
|
SSLContext |
getSSLContext()
The SSL context to use if the application will serve content over HTTPS.
|
int |
getThreads()
The number of threads for handling application requests.
|
boolean |
isCompressResponses()
Whether or not responses should be compressed.
|
boolean |
isDevelopment()
Whether or not the server is in "development" mode.
|
boolean |
isHasBaseDir()
Whether or not the base dir of the application has been set.
|
boolean |
isTimeResponses()
Indicates whether responses should include a 'X-Response-Time' header with the number of milliseconds (to 5 decimal places) it took to process the request.
|
static final int DEFAULT_PORT
static final int DEFAULT_MAX_CONTENT_LENGTH
static final int DEFAULT_THREADS
Runtime.getRuntime().availableProcessors() * 2
.static final long DEFAULT_COMPRESSION_MIN_SIZE
FileSystemBinding getBaseDir() throws NoBaseDirException
FileSystemBinding
.NoBaseDirException
- if this launch config has no base dir set.HandlerFactory getHandlerFactory() throws NoHandlerFactoryException
NoHandlerFactoryException
- if no handler factory was defined (i.e. this launch config isn't used for a HTTP server)int getPort()
Defaults to 5050.
@Nullable InetAddress getAddress()
A value of null causes all interfaces to be bound. Defaults to null.
boolean isDevelopment()
A flag for indicating to Ratpack internals that the app is under development; diagnostics and reloading are more important than performance and security.
In development mode Ratpack will leak internal information through diagnostics and stacktraces by sending them to the response.
true
if the server is in "development" modeint getThreads()
If the value is greater than 0, a thread pool (of this size) will be created for servicing requests and doing computation.
If the value is 0 (default) or less, a thread pool of size Runtime.availableProcessors()
* 2
will be used.
This effectively sizes the ExecController.getExecutor()
thread pool size.
ExecController getExecController()
ByteBufAllocator getBufferAllocator()
Defaults to Netty's PooledByteBufAllocator
.
URI getPublicAddress()
List<String> getIndexFiles()
@Nullable SSLContext getSSLContext()
null
if the application does not use SSL.String getOther(String key, String defaultValue)
Extensions and plugins can use other properties for their configuration.
key
- The property keydefaultValue
- The value to return if the property was not setkey
, or the defaultValue
if it is not setMap<String,String> getOtherPrefixedWith(String prefix)
The prefix is removed from keys of the result map.
prefix
- Property name prefix that should be used for filteringint getMaxContentLength()
boolean isTimeResponses()
Timing starts when processing of the request starts. That is, the number of milliseconds it took to determine the response to send to the client. It does not include the time taken to send the response over the wire.
boolean isCompressResponses()
long getCompressionMinSize()
ImmutableSet<String> getCompressionMimeTypeWhiteList()
If empty, defaults to all mime types not on the black list.
ImmutableSet<String> getCompressionMimeTypeBlackList()
If empty, uses a default that excludes many commonly used compressed types.
boolean isHasBaseDir()