Package nz.org.riskscape.engine.cli
Class CliBootstrap
java.lang.Object
nz.org.riskscape.engine.cli.CliBootstrap
Class for controlling engine boostrapping for a CLI process/engine
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static enum
State machine (ahem) for cli bootrapping -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
We need a special case for loading any default messages defined in the api's jar.nz.org.riskscape.engine.DefaultEngine
Builds anEngine
and populates it with any service providers that may be provided byPlugin
s.nz.org.riskscape.engine.Project
Populates project resources (type, functions, bookmarks etc).protected void
changeState
(CliBootstrap.State nextState, Runnable callback) nz.org.riskscape.engine.ProjectBuilder
nz.org.riskscape.engine.DefaultEngine
nz.org.riskscape.engine.plugin.ExtensionPoints
static CliBootstrap
nz.org.riskscape.engine.i18n.DefaultMessages
nz.org.riskscape.engine.plugin.PluginRepository
nz.org.riskscape.engine.Project
getState()
nz.org.riskscape.cli.Terminal
void
static List<nz.org.riskscape.engine.util.Pair<ch.qos.logback.classic.Logger,
ch.qos.logback.classic.Level>> parseLogLevelFromArgs
(String[] args, nz.org.riskscape.cli.Terminal terminal) Available as a separate static method for unit testingvoid
setApplicationHome
(Path appHome) void
setLogLevel
(String[] args) Scans a list of command line args looking for--log-level=foo
or--log-level foo
void
setPluginRepository
(nz.org.riskscape.engine.plugin.PluginRepository pluginRepository) void
setRootOptions
(CliRoot root) void
setTerminal
(nz.org.riskscape.cli.Terminal term)
-
Field Details
-
PROBLEMS
-
-
Constructor Details
-
CliBootstrap
public CliBootstrap()
-
-
Method Details
-
getInstance
-
changeState
-
setApplicationHome
-
initializePlugins
public void initializePlugins() -
setRootOptions
-
setTerminal
public void setTerminal(nz.org.riskscape.cli.Terminal term) -
buildEngine
public nz.org.riskscape.engine.DefaultEngine buildEngine()Builds an
Engine
and populates it with any service providers that may be provided byPlugin
s.- Returns:
- engine as built
-
buildProject
public nz.org.riskscape.engine.Project buildProject()Populates project resources (type, functions, bookmarks etc).
-
addApiI18nToMessages
public void addApiI18nToMessages()We need a special case for loading any default messages defined in the api's jar. The api code is not loaded as a plugin so we need a special case
-
setLogLevel
Scans a list of command line args looking for
--log-level=foo
or--log-level foo
-
parseLogLevelFromArgs
public static List<nz.org.riskscape.engine.util.Pair<ch.qos.logback.classic.Logger,ch.qos.logback.classic.Level>> parseLogLevelFromArgs(String[] args, nz.org.riskscape.cli.Terminal terminal) Available as a separate static method for unit testing
-
getBuilder
public nz.org.riskscape.engine.ProjectBuilder getBuilder() -
getState
-
getTerminal
public nz.org.riskscape.cli.Terminal getTerminal() -
getCliRoot
-
getEngine
public nz.org.riskscape.engine.DefaultEngine getEngine() -
getProject
public nz.org.riskscape.engine.Project getProject() -
getSettings
-
getPluginRepository
public nz.org.riskscape.engine.plugin.PluginRepository getPluginRepository() -
setPluginRepository
public void setPluginRepository(nz.org.riskscape.engine.plugin.PluginRepository pluginRepository) -
getExtensionPoints
public nz.org.riskscape.engine.plugin.ExtensionPoints getExtensionPoints() -
getMessages
public nz.org.riskscape.engine.i18n.DefaultMessages getMessages() -
getLayout
-