Class CommandLineProgramRegistry


  • public class CommandLineProgramRegistry
    extends java.lang.Object
    A registry for command line programs.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • CommandLineProgramRegistry

        public CommandLineProgramRegistry()
    • Method Detail

      • registerProgram

        public static void registerProgram​(java.lang.String name,
                                           ICommandLineProgram instance)
        Registers a program instance.
        Parameters:
        name - the name of the program (nothing happens if null)
        instance - the instance (nothing happens if null)
      • getRegisteredProgram

        public static ICommandLineProgram getRegisteredProgram​(java.lang.String name)
        Returns a registered program instance.
        Parameters:
        name - the name of the program
        Returns:
        the registered program (may be null for none)
      • unregisterProgram

        public static void unregisterProgram​(java.lang.String name)
        Unregisters a program instance.
        Parameters:
        name - the name of the program (nothing happens if null)
      • obainCommandLineProgram

        public static ICommandLineProgram obainCommandLineProgram​(java.lang.String className)
        Obtains a command line program instance through dynamic class loading.
        Parameters:
        className - the class name
        Returns:
        the instance or null if no instance can be created, reason will occur in log