Class AbstractLauncher

java.lang.Object
org.jdrupes.builder.startup.AbstractLauncher
All Implemented Interfaces:
Launcher
Direct Known Subclasses:
BootstrapLauncher, DirectLauncher

public abstract class AbstractLauncher extends Object implements Launcher
A default implementation of a Launcher.
  • Field Details

    • jdbldProps

      protected static final Properties jdbldProps
      The JDrupes Builder properties read from the file .jdbld.properties in the root project.
    • log

      protected final Logger log
      The log.
    • commandLine

      protected final org.apache.commons.cli.CommandLine commandLine
      The command line.
  • Constructor Details

    • AbstractLauncher

      public AbstractLauncher(String[] args)
      Instantiates a new abstract launcher.
      Parameters:
      args - the command line arguments
  • Method Details

    • baseOptions

      protected final org.apache.commons.cli.Options baseOptions()
      Return the handled options.
      Returns:
      the options
    • findProjects

      protected void findProjects(ClassLoader clsLoader, List<Class<? extends RootProject>> rootProjects, List<Class<? extends Project>> subprojects)
      Find projects. The classpath is scanned for classes that implement Project but do not implement Masked.
      Parameters:
      clsLoader - the cls loader
      rootProjects - classes that implement RootProject
      subprojects - classes that implement Project but not RootProject
    • unwrapBuildException

      protected final <T> T unwrapBuildException(Callable<T> todo)
      A utility method that invokes the callable. If an exception occurs during the invocation, it unwraps the causes until it finds the root BuildException, prints the message from this exception and exits.
      Type Parameters:
      T - the generic type
      Parameters:
      todo - the todo
      Returns:
      the t