An AgE node is started by a bootstrapper. Usually you will be using CliNodeBootsrapper — it allows one to start a separate node instance from the command line. However, sometimes you may need to create your own bootstrapper (e.g., to embed AgE into your application).
Standard Command-line Usage
The command-line-based bootstrapper is available as org.jage.platform.cli.CliNodeBootstrapper. Parameters it uses are dependent on the node configuration, but in the default configuration you usually need to provide:
- a node configuration file as the
-Dage.node.confparameter, - a computation configuration file as the
-Dage.computation.confparameter.
The node configuration is required and describes capabilities of the node instance. The computation configuration should be provided only on one node in the distributed environment.
Resource specification
When specifying a resource to load by the platform (e.g., a configuration file in the age.node.conf option) it is possible to use different protocols.
Following protocols are available and recognised by default:
classpath— for loading files from paths in the current classpath, e.g.:
classpath:org/example/age.xml
file— for absolute or relative paths in the filesystem, e.g.:
file:/home/example/age.xml
jar— for loading resources from a JAR file, e.g.:
jar:file:/home/example/example.jar!/age.xml
http[s], ftp— for loading remote resources using HTTP/HTTPS or FTP protocol, e.g.:
http://example.com/age.xml
Other protocols may also be recognised if your Java runtime supports them.
Changing Default Behaviour
In some cases you may want to use a command line bootstrapper but provide configuration files in another way. CliNodeBootstrapper accepts an argument -m that overrides the standard name of the Lifecycle Manager.
java -cp $CLASSPATH org.jage.platform.cli.CliNodeBootstrapper -m my.own.LifecycleManager