Interface JavaMainCaller

All Known Implementing Classes:
JavaMainCallerByFork, JavaMainCallerInProcess, JavaMainCallerSupport

public interface JavaMainCaller
This interface is used to create a call on a main method of a java class. The important implementations are JavaCommand and ReflectionJavaCaller
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addArgs(String... args)
    Adds arguments for the process
    void
    addEnvVar(String key, String value)
    Adds an environemnt variable
    void
    addJvmArgs(String... args)
    Adds a JVM arg.
    void
    addOption(String key, boolean value)
    Adds the key if the value is true
    void
    addOption(String key, File value)
    Adds an option (key-file pair).
    void
    addOption(String key, String value)
    Adds option (basically two arguments)
    void
    request run to be redirected to maven/requester logger
    void
    run(boolean displayCmd)
     
    boolean
    run(boolean displayCmd, boolean throwFailure)
    Runs the JavaMain with all the built up arguments/options
    spawn(boolean displayCmd)
    run the command without stream redirection nor waiting for exit
  • Method Details

    • addEnvVar

      void addEnvVar(String key, String value)
      Adds an environemnt variable
    • addJvmArgs

      void addJvmArgs(String... args)
      Adds a JVM arg. Note: This is not available for in-process "forks"
    • addArgs

      void addArgs(String... args)
      Adds arguments for the process
    • addOption

      void addOption(String key, String value)
      Adds option (basically two arguments)
    • addOption

      void addOption(String key, File value)
      Adds an option (key-file pair). This will pull the absolute path of the file
    • addOption

      void addOption(String key, boolean value)
      Adds the key if the value is true
    • redirectToLog

      void redirectToLog()
      request run to be redirected to maven/requester logger
    • run

      void run(boolean displayCmd) throws Exception
      Throws:
      Exception
    • run

      boolean run(boolean displayCmd, boolean throwFailure) throws Exception
      Runs the JavaMain with all the built up arguments/options
      Throws:
      Exception
    • spawn

      SpawnMonitor spawn(boolean displayCmd) throws Exception
      run the command without stream redirection nor waiting for exit
      Parameters:
      displayCmd -
      Returns:
      the spawn Process (or null if no process was spawned)
      Throws:
      Exception