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 to modules.
    • ${ceres.context}.libDirs - the application's library directories, defaults to lib.
    • ${ceres.context}.mainClass - the main class to be used, defaults to com.bc.ceres.core.runtime.RuntimeLauncher (which launches a Ceres module runtime).
    • ${ceres.context}.classpath - the main application classpath, defaults to null.
    • ${ceres.context}.debug - output extra debugging info.
    • ${ceres.context}.logLevel - the log level, for valid values see Level.
    With the exception of ceres.context and ${ceres.context}.config all properties can also be specified in the configuration file. However, system properties always override configuration properties.
    • Method Detail

      • getContextId

        String getContextId()
        The Ceres context identifier, e.g. "beam".
        Returns:
        the context identifier.
      • getContextProperty

        String getContextProperty​(String key)
        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 of someKey.

        Parameters:
        key - the context key
        Returns:
        the property value or null if a configuration property with the name is undefined.
      • getContextProperty

        String getContextProperty​(String key,
                                  String defaultValue)
        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 of someKey.

        Parameters:
        key - the context key
        defaultValue - 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()
      • 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 the lib directories nor in the modules 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:
        getMainClassName()
      • getApplicationId

        String getApplicationId()
        Returns:
        The identifier of the application or null if usingModuleRuntime is false.
      • isUsingModuleRuntime

        boolean isUsingModuleRuntime()
        Returns:
        true if a Ceres runtime will be started, false if a 'normal' main of the main 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.