Class RuntimeFactory

java.lang.Object
com.bc.ceres.core.runtime.RuntimeFactory

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

    • RuntimeFactory

      public RuntimeFactory()
  • Method Details

    • 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
    • createRuntime

      public static ModuleRuntime createRuntime(RuntimeConfig config, String[] commandLineArgs, ProgressMonitor progressMonitor)
      Creates a new module runtime with a client supplied progress monitor.
      Parameters:
      config - the runtime's configuration
      commandLineArgs - the command line arguments passed to the application
      progressMonitor - the progress monitor which is informed about the launch sequence's progress
      Returns:
      a module runtime instance
      See Also:
    • 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.