java.lang.Object | ||
↳ | com.google.inject.AbstractModule | |
↳ | uk.ac.imperial.presage2.core.cli.run.ExecutorModule |
This AbstractModule binds a set of SimulationExecutor
s which
can be used by an ExecutorManager
. This module will usually be loaded
via load()
which will create the module from configuration files if
present.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Load an AbstractModule which can inject an
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.inject.AbstractModule
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.inject.Module
|
Load an AbstractModule which can inject an
ExecutorManager
with the appropriate SimulationExecutor
s
as per provided configuration.
The executor config can be provided in two ways (in order of precedence):
executors.properties
file on the classpath. This file
should contain a module
key who's value is the fully
qualified name of a class which extends AbstractModule and has a
public constructor which takes a single Properties object as an
argument or public no-args constructor. An instance of this class will be
returned.executors.json
file on the classpath. This file contains
a specification of the executors to load in JSON format. If this file is
valid we will instantiate each executor defined in the spec and add it to
an ExecutorModule
which will provide the bindings for them.
The executors.json
file should contain a JSON object with
the following:
executors
key whose value is an array. Each element of
the array is a JSON object with the following keys:
class
: the fully qualified name of the executor class.args
: an array of arguments to pass to a public
constructor of the class.enableLogs
(optional): boolean value whether this
executor should save logs to file. Defaults to global value.logDir
(optional): string path to save logs to. Defaults
to global valueenableLogs
(optional): Global value for enableLogs for
each executor. Defaults to false.logDir
(optional): Global value for logDir for each
executor. Default values depend on the executor.e.g.:
{ "executors": [{ "class": "my.fully.qualified.Executor", "args": [1, "some string", true] },{ ... }], "enableLogs": true }