Class DiarcConfiguration

java.lang.Object
edu.tufts.hrilab.diarc.DiarcConfiguration
Direct Known Subclasses:
YamlDiarcConfiguration

public abstract class DiarcConfiguration extends Object
  • Field Details

    • log

      protected org.slf4j.Logger log
    • diarcComponents

      protected List<DiarcComponent> diarcComponents
    • cliOptions

      protected org.apache.commons.cli.Options cliOptions
      Command 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

      protected List<org.apache.commons.cli.Option> additionalUsageInfo()
      Override this method to define command line options available in sub-class. This should be paired with a parseArgs implementation.
      Returns:
    • createInstance

      public final <T extends DiarcComponent> T createInstance(Class<T> clazz)
      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

      public final <T extends DiarcComponent> T createInstance(Class<T> clazz, String[] args)
      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

      public final <T extends DiarcComponent> T createInstance(Class<T> clazz, String args)
      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 arguments
      registerWithTrade - true/false whether to register with TRADE
      Returns:
    • main

      public static final void main(String[] args)
      Main method to allow starting of a single DIARC configuration from the command line.
      Parameters:
      args -