T - the type of configuration class for this applicationpublic abstract class Application<T extends Configuration>
extends java.lang.Object
| Modifier | Constructor | Description |
|---|---|---|
protected |
Application() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
addDefaultCommands(Bootstrap<T> bootstrap) |
Called by
run(String...) to add the standard "server" and "check" commands |
protected void |
bootstrapLogging() |
|
protected ch.qos.logback.classic.Level |
bootstrapLogLevel() |
The log level at which to bootstrap logging on application startup.
|
java.lang.Class<T> |
getConfigurationClass() |
Returns the
Class of the configuration class type parameter. |
java.lang.String |
getName() |
Returns the name of the application.
|
void |
initialize(Bootstrap<T> bootstrap) |
Initializes the application bootstrap.
|
protected void |
onFatalError() |
Called by
run(String...) to indicate there was a fatal error running the requested command. |
void |
run(java.lang.String... arguments) |
Parses command-line arguments and runs the application.
|
abstract void |
run(T configuration,
Environment environment) |
When the application runs, this is called after the
Bundles are run. |
protected ch.qos.logback.classic.Level bootstrapLogLevel()
protected void bootstrapLogging()
public java.lang.Class<T> getConfigurationClass()
Class of the configuration class type parameter.Generics.getTypeParameter(Class, Class)public java.lang.String getName()
public void initialize(Bootstrap<T> bootstrap)
bootstrap - the application bootstrappublic abstract void run(T configuration, Environment environment) throws java.lang.Exception
Bundles are run. Override it to add
providers, resources, etc. for your application.configuration - the parsed Configuration objectenvironment - the application's Environmentjava.lang.Exception - if something goes wrongpublic void run(java.lang.String... arguments)
throws java.lang.Exception
public
static void main entry point in your application.arguments - the command-line argumentsjava.lang.Exception - if something goes wrongprotected void addDefaultCommands(Bootstrap<T> bootstrap)
run(String...) to add the standard "server" and "check" commandsbootstrap - the bootstrap instanceprotected void onFatalError()
run(String...) to indicate there was a fatal error running the requested command.
The default implementation calls System.exit(int) with a non-zero status code to terminate the
application.Copyright © 2018. All rights reserved.