public interface Application
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activate the Application.
|
Cache |
cache()
Application
Cache .
|
ClassLoader |
classLoader()
Application
ClassLoader .
|
Config |
config()
Application
Config .
|
Crypto |
crypto()
Application
Crypto .
|
Charset |
defaultCharset()
Application default
Charset .
|
Errors |
errors()
Application
Errors .
|
Events |
events()
Application Events.
|
default ExecutorService |
executor()
Default Application ExecutorService.
|
ApplicationExecutors |
executors()
Application Executors.
|
HttpBuilders |
httpBuilders()
HTTP API Objects Builders.
|
boolean |
isActive()
Application activation state.
|
Langs |
langs()
Application
Langs .
|
MetaData |
metaData()
Application
MetaData .
|
MimeTypes |
mimeTypes()
Application
MimeTypes .
|
Mode |
mode()
Application Mode.
|
ParameterBinders |
parameterBinders()
Application
ParameterBinders .
|
void |
passivate()
Passivate the Application.
|
<T> T |
plugin(Class<T> pluginApiType)
Lookup a Plugin's API.
|
<T> Iterable<T> |
plugins(Class<T> pluginApiType)
Lookup possibly several Plugin's API.
|
ReverseRoutes |
reverseRoutes()
Application
ReverseRoutes .
|
Routes |
routes()
Application
Routes .
|
Stacktraces.FileURLGenerator |
sourceFileURLGenerator()
FileURLGenerator for Application Sources.
|
Templates |
templates()
Application
Templates .
|
File |
tmpdir()
Application temporary directory
File .
|
void activate() throws ActivationException
IllegalStateException
- if the Application is already active.
ActivationException
- if something goes wrong.
void passivate()
IllegalStateException
- if the Application was not active.
boolean isActive()
Config config()
Config
.
Don't hold references to the Config instance in order to make your code Mode.DEV
friendly.
Config
<T> T plugin(Class<T> pluginApiType)
Don't hold references to the Plugins API instances in order to make your code Mode.DEV
friendly.
T
- Parameterized Plugin API type
pluginApiType
- Plugin type
IllegalArgumentException
- if no Plugin is found for the given API type
IllegalStateException
- if the Application is not active
<T> Iterable<T> plugins(Class<T> pluginApiType)
Don't hold references to the Plugins API instances in order to make your code Mode.DEV
friendly.
T
- Parameterized Plugin API type
pluginApiType
- Plugin type
IllegalStateException
- if the Application is not active
Crypto crypto()
Crypto
.
Don't hold references to the Crypto instance in order to make your code Mode.DEV
friendly.
Crypto
Langs langs()
Langs
.
Don't hold references to the Langs instance in order to make your code Mode.DEV
friendly.
Langs
Charset defaultCharset()
Charset
.
Charset
File tmpdir()
File
.
File
ClassLoader classLoader()
ClassLoader
.
Don't hold references to the ClassLoader instance to prevent memory leaks in Mode.DEV
.
ClassLoader
default ExecutorService executor()
Convey the current Context to parallel threads if any.
Use when composing CompletableFutures or to submit parallel Stream operations.
ApplicationExecutors executors()
Convey the current Context to parallel threads if any.
Use when composing CompletableFutures or to submit parallel Stream operations.
Events events()
HttpBuilders httpBuilders()
Use this to create instances of HTTP API Objects found in the io.werval.api.http package. All builders are immutable and reusable.
Routes routes()
Routes
.
Don't hold references to the Routes instance in order to make your code Mode.DEV
friendly.
The Application Routes include Routes contributed by registered Plugins.
Routes
IllegalStateException
- if the Application is not active
ReverseRoutes reverseRoutes()
ReverseRoutes
.
Don't hold references to the ReverseRoutes instance in order to make your code Mode.DEV
friendly.
ReverseRoutes
IllegalStateException
- if the Application is not active
ParameterBinders parameterBinders()
ParameterBinders
.
Don't hold references to the ParameterBinders instance in order to make your code Mode.DEV
friendly.
ParameterBinders
MimeTypes mimeTypes()
MimeTypes
.
Don't hold references to the MimeTypes instance in order to make your code Mode.DEV
friendly.
MimeTypes
MetaData metaData()
MetaData
.
Don't hold references to the MetaData instance in order to make your code Mode.DEV
friendly.
MetaData
Cache cache()
Cache
.
Don't hold references to the Cache instance in order to make your code Mode.DEV
friendly.
Cache
Templates templates()
Templates
.
Don't hold references to the Templates instance in order to make your code Mode.DEV
friendly.
Templates
IllegalArgumentException
- if no Plugin is found for Templates
Errors errors()
Errors
.
Don't hold references to the Errors instance in order to make your code Mode.DEV
friendly.
Errors
Stacktraces.FileURLGenerator sourceFileURLGenerator()
Works only in Mode.DEV
mode.