Class MainCommandLineSupport

  • Direct Known Subclasses:
    Main

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

      • MainCommandLineSupport

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

        public MainCommandLineSupport()
    • Method Detail

      • 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.
      • 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
      • showOptionsHeader

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