Package edu.tufts.hrilab.diarc
Class DiarcConfiguration
java.lang.Object
edu.tufts.hrilab.diarc.DiarcConfiguration
- Direct Known Subclasses:
YamlDiarcConfiguration
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.commons.cli.OptionsCommand line options.protected List<DiarcComponent>protected org.slf4j.Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<org.apache.commons.cli.Option>Override this method to define command line options available in sub-class.final <T extends DiarcComponent>
TcreateInstance(Class<T> clazz) Convenience method when no additional component args are needed.final <T extends DiarcComponent>
TcreateInstance(Class<T> clazz, String args) Convenience method to pass all args as a single String, and automatically registers with TRADE.final <T extends DiarcComponent>
TcreateInstance(Class<T> clazz, String[] args) Convenience method to automatically register with TRADE.final <T extends DiarcComponent>
TcreateInstance(Class<T> clazz, String args, boolean registerWithTrade) Convenience method to pass all args as a single String, and optionally registers with TRADE.static final voidMain method to allow starting of a single DIARC configuration from the command line.protected voidparseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class.abstract voidvoid
-
Field Details
-
log
protected org.slf4j.Logger log -
diarcComponents
-
cliOptions
protected org.apache.commons.cli.Options cliOptionsCommand line options.
-
-
Constructor Details
-
DiarcConfiguration
public DiarcConfiguration()
-
-
Method Details
-
runConfiguration
public abstract void runConfiguration() -
shutdownConfiguration
public void shutdownConfiguration() -
parseArgs
protected void parseArgs(org.apache.commons.cli.CommandLine cmdLine) Override this method to parse command line args in the sub-class. Called directly after construction to pass runtime values that will override default values. This should parse all the options that additionalUsageInfo provides.- Parameters:
cmdLine-
-
additionalUsageInfo
Override this method to define command line options available in sub-class. This should be paired with a parseArgs implementation.- Returns:
-
createInstance
Convenience method when no additional component args are needed. Automatically register with TRADE.- Type Parameters:
T-- Parameters:
clazz- class to be instantiated (must extend DiarcComponent)- Returns:
-
createInstance
Convenience method to automatically register with TRADE.- Type Parameters:
T-- Parameters:
clazz- class to be instantiated (must extend DiarcComponent)args- command line arguments- Returns:
-
createInstance
Convenience method to pass all args as a single String, and automatically registers with TRADE.- Type Parameters:
T-- Parameters:
clazz- class to be instantiated (must extend DiarcComponent)args- command line arguments- Returns:
-
createInstance
public final <T extends DiarcComponent> T createInstance(Class<T> clazz, String args, boolean registerWithTrade) Convenience method to pass all args as a single String, and optionally registers with TRADE.- Type Parameters:
T-- Parameters:
clazz- class to be instantiated (must extend DiarcComponent)args- command line argumentsregisterWithTrade- true/false whether to register with TRADE- Returns:
-
main
Main method to allow starting of a single DIARC configuration from the command line.- Parameters:
args-
-