Ceres (Wikipedia) is a platform for pluggable Java modules. It provides to BEAM the capability to install and update modules from a central module repository.
- The platform provides one or more module <i>runtimes</i>. A runtime is invoked using the
- Each runtime manages one or more modules.
- A module is a JAR or a directory which has a file
module.xmlin its root. This file is the module manifest, which provides module metadata, such as name, version, description, dependencies, etc.
- There is one system module instance per runtime. The system module's name is
- All modules implicitly depend on the system module.
- A module can have explicit dependencies on other modules.
- Each module has its own classpath (thus class loader) which is defined by all other modules on which the module depends.
- If a module is a directory (and not a JAR), all JARs found in that directory are automatically added to the module's classpath.
- Each module can expose one or more extension points.
- Each module can expose one or more extensions which extend a certain extension point.
- A module can have an activator, which is coded in Java and is invoked when the runtime starts and stops.
Typical Application Directory Structure
The typical standard directory for an application based on Ceres is:
Home directory of application
Location where the application lauchers are installed. Should also contain
Optional location where configuration files are installed. If file
Location with common libraries. If it exists, the launcher automatically adds all Java libraries (JARs and directories) to the classpath of each module. The actual name of this directory is configurable by adapting
Mandatory location where installed modules are kept. The actual name of this directory is configurable by adapting
Note that Ceres does not limit
<app-home>/ to contain only a single application. You can configure as much applications as you like. Each application can be configured separately. Simply place a
<app>.config in the
Launching an Application
A Ceres-based application is started using the launcher
For example, from a Windows batch file (*.bat):
or a Unix script (*.sh):
The Java property
ceres.context sets the application context name for a runtime,
beam in the example above. Once the application context name is known, the Ceres launcher honours a number of configuration parameters of the form
-D<context>.<property>=<value>. In the example above
beam.app tells Ceres which application to launch. The value of this parameter must be the name of a registered Ceres application. In the example above, the value is
VisatApp. This name is defined in the
module.xml of the BEAM module
The implementing class is
org.esa.beam.visat.VisatMain, it implements the Ceres core interface
com.bc.ceres.core.runtime.RuntimeRunnable, which is used by Ceres to launch applications.
Configuring the Launcher
The Ceres configuration parameters can be passed as Java system properties on the Java command line (see example above) or also in the
<app>.config file which has Java Properties format. The mandatory Ceres configuration parameters are:
The application's home directory. Used by the launcher to find more configuration information and default locations.
The application identifier. Must be the name of an extension of the
Other configuration parameters are best understood by reading the configuration file for BEAM: