public final class Application extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PROPERTY_CONFIG_DIRECTORY |
static String |
PROPERTY_INSTALLATION_DIRECTORY |
static String |
PROPERTY_LANGUAGE_TAG |
static String |
PROPERTY_LOG_DIRECTORY |
static String |
PROPERTY_LOGGING_CONFIGURATION_URL |
static String |
PROPERTY_TMP_DIRECTORY |
| Modifier and Type | Method and Description |
|---|---|
void |
closed(AsyncCloseable<?> c)
Unregister an instance to close on application shutdown.
|
void |
closed(Closeable c)
Unregister an instance to close on application shutdown.
|
Map<String,String> |
getApplicationSpecificProperties() |
String |
getArtifactId() |
ApplicationClassLoader |
getClassLoader()
Return the application class loader.
|
List<String> |
getCommandLineArguments() |
Console |
getConsole() |
Object |
getData(String name)
Get a data associated with this application.
|
Logger |
getDefaultLogger() |
String |
getGroupId() |
<T> T |
getInstance(Class<T> clazz)
Return the singleton stored for this application.
|
String[] |
getLanguageTag() |
LibrariesManager |
getLibrariesManager() |
Locale |
getLocale() |
LocalizedProperties |
getLocalizedProperties() |
LoggerFactory |
getLoggerFactory() |
String |
getPreference(String name)
Return a preference.
|
String |
getProperty(String name)
Return the property value or null.
|
IO.Readable |
getResource(String filename,
byte priority)
Get a resource from the class loader as an IO.Readable.
|
long |
getStartTime() |
ThreadFactory |
getThreadFactory() |
Version |
getVersion() |
void |
interrupted(Thread t)
Unregister a thread that must be interrupted on application shutdown.
|
boolean |
isDebugMode() |
boolean |
isReleaseMode() |
boolean |
isStopping() |
IAsync<Exception> |
loadPreferences()
Load preferences.
|
Object |
removeData(String name)
Remove a data associated with this application.
|
<T> T |
removeInstance(Class<T> clazz)
Remove the singleton stored for this application.
|
Object |
setData(String name,
Object value)
Set a data associated with this application and return previously associated data with this name.
|
<T> T |
setInstance(Class<T> clazz,
T instance)
Set the singleton stored for this application.
|
void |
setLocale(Locale l)
Set the new application language / locale.
|
void |
setPreference(String name,
String value)
Set a preference.
|
void |
setProperty(String name,
String value)
Set a property for this application.
|
static IAsync<ApplicationBootstrapException> |
start(Artifact artifact,
boolean debugMode)
Method to call at the beginning of the application, typically in the main method.
|
static IAsync<ApplicationBootstrapException> |
start(Artifact artifact,
String[] args,
boolean debugMode)
Method to call at the beginning of the application, typically in the main method.
|
static IAsync<ApplicationBootstrapException> |
start(Artifact artifact,
String[] commandLineArguments,
Map<String,String> properties,
boolean debugMode,
ThreadFactory threadFactory,
LibrariesManager librariesManager,
Appender defaultLogAppender)
Method to call at the beginning of the application, typically in the main method.
|
void |
stop()
Stop this application and release resources.
|
void |
toClose(AsyncCloseable<?> c)
Register an instance to close on application shutdown.
|
void |
toClose(Closeable c)
Register an instance to close on application shutdown.
|
void |
toInterruptOnShutdown(Thread t)
Register a thread that must be interrupted on application shutdown.
|
public static final String PROPERTY_LOGGING_CONFIGURATION_URL
public static final String PROPERTY_INSTALLATION_DIRECTORY
public static final String PROPERTY_CONFIG_DIRECTORY
public static final String PROPERTY_LOG_DIRECTORY
public static final String PROPERTY_TMP_DIRECTORY
public static final String PROPERTY_LANGUAGE_TAG
public long getStartTime()
public String getGroupId()
public String getArtifactId()
public Version getVersion()
public boolean isDebugMode()
public boolean isReleaseMode()
public String getProperty(String name)
public ThreadFactory getThreadFactory()
public Console getConsole()
public Locale getLocale()
public void setLocale(Locale l)
public LocalizedProperties getLocalizedProperties()
public String[] getLanguageTag()
public LoggerFactory getLoggerFactory()
public Logger getDefaultLogger()
public LibrariesManager getLibrariesManager()
public ApplicationClassLoader getClassLoader()
public IO.Readable getResource(String filename, byte priority)
public void toClose(Closeable c)
public void toClose(AsyncCloseable<?> c)
public void closed(Closeable c)
public void closed(AsyncCloseable<?> c)
public void toInterruptOnShutdown(Thread t)
public void interrupted(Thread t)
public boolean isStopping()
public <T> T getInstance(Class<T> clazz)
public <T> T setInstance(Class<T> clazz, T instance)
public <T> T removeInstance(Class<T> clazz)
public Object setData(String name, Object value)
public static IAsync<ApplicationBootstrapException> start(Artifact artifact, String[] commandLineArguments, Map<String,String> properties, boolean debugMode, ThreadFactory threadFactory, LibrariesManager librariesManager, Appender defaultLogAppender)
public static IAsync<ApplicationBootstrapException> start(Artifact artifact, boolean debugMode)
public static IAsync<ApplicationBootstrapException> start(Artifact artifact, String[] args, boolean debugMode)
public void stop()
Copyright © 2019. All rights reserved.