Class MainCommandLineSupport

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.main.BaseMainSupport
org.apache.camel.main.MainSupport
org.apache.camel.main.MainCommandLineSupport
Direct Known Subclasses:
Main

public abstract class MainCommandLineSupport extends MainSupport
Support for command line arguments to Camel main.
  • Field Details

  • Constructor Details

    • MainCommandLineSupport

      @SafeVarargs public MainCommandLineSupport(Class<? extends org.apache.camel.CamelConfiguration>... configurationClasses)
    • MainCommandLineSupport

      public MainCommandLineSupport()
  • Method Details

    • getArgumentProperties

      public Properties getArgumentProperties()
    • setArgumentProperties

      public void setArgumentProperties(Properties argumentProperties)
      Sets command line argument as properties for the properties component.
    • setArgumentProperties

      public void setArgumentProperties(Map<String,Object> initialProperties)
      Sets command line argument as properties for the properties component.
    • addArgumentProperty

      public void addArgumentProperty(String key, String value)
      Adds a property (command line) for the properties component.
      Parameters:
      key - the property key
      value - the property value
    • initOptions

      protected void initOptions()
    • addInitialOptions

      protected void addInitialOptions()
    • showOptions

      public void showOptions()
      Displays the command line options.
    • parseArguments

      public void parseArguments(String[] arguments)
      Parses the command line arguments.
    • addOption

      public void addOption(MainCommandLineSupport.Option option)
    • run

      public int run(String[] args) throws Exception
      Parses the command line arguments then runs the program. The run method will keep blocking until the program is stopped.
      Returns:
      the exit code, usually 0 for normal termination.
      Throws:
      Exception
    • configurePropertiesService

      protected void configurePropertiesService(org.apache.camel.CamelContext camelContext) throws Exception
      Overrides:
      configurePropertiesService in class BaseMainSupport
      Throws:
      Exception
    • showOptionsHeader

      public void showOptionsHeader()
      Displays the header message for the command line options.