Package com.bc.ceres.core.runtime
Class RuntimeFactory
java.lang.Object
com.bc.ceres.core.runtime.RuntimeFactory
A factory for runtime instances.
It provides the main entry point to the module runtime framework.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ProgressMonitor
createProgressMonitor
(RuntimeConfig config) Creates a default progress monitor for the runtime.static ModuleRuntime
createRuntime
(RuntimeConfig config, String[] commandLineArgs) Creates a new module runtime.static ModuleRuntime
createRuntime
(RuntimeConfig config, String[] commandLineArgs, ProgressMonitor progressMonitor) Creates a new module runtime with a client supplied progress monitor.static RuntimeConfig
Creates a default configuration for an application composed of multiple modules.
-
Constructor Details
-
RuntimeFactory
public RuntimeFactory()
-
-
Method Details
-
createRuntimeConfig
Creates a default configuration for an application composed of multiple modules.A module runtime is configured through the following system properties:
${ceres.context}.home
- the home directory. If not provided it will be derived from the current classloader's classpath.${ceres.context}.config
- the directory for configuration files, such asconfig.properties
.${ceres.context}.libDirs
- the directory which is scanned for JARs. These are automatically added the runtime's classpath.${ceres.context}.modules
- the directory which is scanned for modules.${ceres.context}.app
- the identifier of an extension registered with theceres-core:applications
extension point.
${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
Creates a new module runtime. The supplied class loader is used for two purposes:- Its classpath is scanned for additional modules
- It serves as parent class loader for all modules
- Parameters:
config
- the runtime's configurationcommandLineArgs
- 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 configurationcommandLineArgs
- the command line arguments passed to the applicationprogressMonitor
- the progress monitor which is informed about the launch sequence's progress- Returns:
- a module runtime instance
- See Also:
-
createProgressMonitor
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.
-