Class RuntimeFactory


  • public final class RuntimeFactory
    extends Object
    A factory for runtime instances. It provides the main entry point to the module runtime framework.
    • Constructor Detail

      • RuntimeFactory

        public RuntimeFactory()
    • Method Detail

      • createRuntimeConfig

        public static RuntimeConfig createRuntimeConfig()
                                                 throws CoreException
        Creates a default configuration for an application composed of multiple modules.

        A module runtime is configured through the following system properties:

        1. ${ceres.context}.home - the home directory. If not provided it will be derived from the current classloader's classpath.
        2. ${ceres.context}.config - the directory for configuration files, such as config.properties.
        3. ${ceres.context}.libDirs - the directory which is scanned for JARs. These are automatically added the runtime's classpath.
        4. ${ceres.context}.modules - the directory which is scanned for modules.
        5. ${ceres.context}.app - the identifier of an extension registered with the ceres-core:applications extension point.
        where ${ceres.context} is the value of the runtime's context identifier which defaults to "ceres".
        Returns:
        a default configuration
        Throws:
        CoreException - if a runtime core error occurs
      • createRuntime

        public static ModuleRuntime createRuntime​(RuntimeConfig config,
                                                  String[] commandLineArgs)
        Creates a new module runtime. The supplied class loader is used for two purposes:
        1. Its classpath is scanned for additional modules
        2. It serves as parent class loader for all modules
        Parameters:
        config - the runtime's configuration
        commandLineArgs - the command line arguments passed to the application
        Returns:
        a module runtime instance
      • createProgressMonitor

        public static ProgressMonitor createProgressMonitor​(RuntimeConfig config)
        Creates a default progress monitor for the runtime. If a splash screen (java.awt.SplashScreen) is available a progress monitor will be created which outputs its progress messages to on the bottom of the splash screen image.
        Parameters:
        config - the runtime configuration
        Returns:
        A progress monitor.