Package com.bc.ceres.core.runtime
Interface RuntimeConfig
public interface RuntimeConfig
The configuration for a Ceres runtime.
The following system properties are recognized:
ceres.context
- the context ID used for the application, e.g. "beam". Mandatory.${ceres.context}.home
- the application's home directory. If not given, the launcher will try to find one.${ceres.context}.config
- path to a configuration file (Java properties file).${ceres.context}.modules
- the application's modules directory, defaults tomodules
.${ceres.context}.libDirs
- the application's library directories, defaults tolib
.${ceres.context}.mainClass
- the main class to be used, defaults tocom.bc.ceres.core.runtime.RuntimeLauncher
(which launches a Ceres module runtime).${ceres.context}.classpath
- the main application classpath, defaults tonull
.${ceres.context}.debug
- output extra debugging info.${ceres.context}.logLevel
- the log level, for valid values seeLevel
.
ceres.context
and ${ceres.context}.config
all properties can also be
specified in the configuration file. However, system properties always override configuration properties.-
Method Summary
Modifier and TypeMethodDescriptionThe configuration file path.The Ceres context identifier, e.g.getContextProperty
(String key) Gets the value of a configuration property with the name${ceres.context}.key
.getContextProperty
(String key, String defaultValue) Gets the value of a configuration property with the name${ceres.context}.key
.The home directory path.String[]
The library directory paths.Returns the logger.The name of the class providing the main entry point.An optional classpath containing the paths of additional application directories and ZIPs/JARs.The modules directory path.boolean
isDebug()
Output debugging information?boolean
-
Method Details
-
getContextId
String getContextId()The Ceres context identifier, e.g. "beam".- Returns:
- the context identifier.
-
getContextProperty
Gets the value of a configuration property with the name${ceres.context}.key
.The method also substitues all occurences of
${someKey}
in the property value with the value ofsomeKey
.- Parameters:
key
- the context key- Returns:
- the property value or
null
if a configuration property with the name is undefined.
-
getContextProperty
Gets the value of a configuration property with the name${ceres.context}.key
.The method also substitues all occurences of
${someKey}
in the property value with the value ofsomeKey
.- Parameters:
key
- the context keydefaultValue
- the default value- Returns:
- the property value or the
defaultValue
if a configuration property with the name is undefined.
-
getMainClassName
String getMainClassName()The name of the class providing the main entry point.- Returns:
- the name of the main class to be launched, may be
null
. - See Also:
-
getMainClassPath
String getMainClassPath()An optional classpath containing the paths of additional application directories and ZIPs/JARs. Path entries are separated by the system-specific path separator.This classpath can be used to specify classes (e.g. the
main class
), that are neither contained in one of thelib
directories nor in themodules
directory.If specified, the main classpath will be the top-level classpath.
- Returns:
- the home directory path, may be
null
. - Since:
- Ceres 0.11
- See Also:
-
getApplicationId
String getApplicationId()- Returns:
- The identifier of the application or
null
ifusingModuleRuntime
isfalse
.
-
isUsingModuleRuntime
boolean isUsingModuleRuntime()- Returns:
true
if a Ceres runtime will be started,false
if a 'normal'main
of themain class
will be invoked.
-
getHomeDirPath
String getHomeDirPath()The home directory path.- Returns:
- home directory path.
-
getConfigFilePath
String getConfigFilePath()The configuration file path.- Returns:
- configuration file path or
null
if not specified.
-
getLibDirPaths
String[] getLibDirPaths()The library directory paths.- Returns:
- all library directory paths or an empty array if not specified.
-
getModulesDirPath
String getModulesDirPath()The modules directory path.- Returns:
- modules directory path or
null
if not specified.
-
isDebug
boolean isDebug()Output debugging information?- Returns:
true
if so.
-
getLogger
Logger getLogger()Returns the logger.- Returns:
- the logger.
-