Class AbstractCommandExecutor<T extends BaseCommandConfiguration>

  • All Implemented Interfaces:
    org.codehaus.plexus.logging.LogEnabled
    Direct Known Subclasses:
    CommandExecutor, OfflineCommandExecutor

    public abstract class AbstractCommandExecutor<T extends BaseCommandConfiguration>
    extends org.codehaus.plexus.logging.AbstractLogEnabled
    An abstract command executor for executing CLI commands.
    Author:
    jdenise@redhat.com
    • Constructor Detail

      • AbstractCommandExecutor

        public AbstractCommandExecutor()
    • Method Detail

      • execute

        public abstract void execute​(T config,
                                     org.jboss.galleon.universe.maven.repo.MavenRepoManager artifactResolver)
                              throws org.apache.maven.plugin.MojoFailureException,
                                     org.apache.maven.plugin.MojoExecutionException
        Executes CLI commands based on the configuration.
        Parameters:
        config - the configuration used to execute the CLI commands
        artifactResolver - Resolver to retrieve CLI artifact for in-process execution.
        Throws:
        org.apache.maven.plugin.MojoFailureException - if the JBoss Home directory is required and invalid
        org.apache.maven.plugin.MojoExecutionException - if an error occurs executing the CLI commands
      • executeInNewProcess

        protected abstract int executeInNewProcess​(T config,
                                                   Path scriptFile,
                                                   StandardOutput stdout)
                                            throws org.apache.maven.plugin.MojoExecutionException,
                                                   IOException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        IOException
      • executeInNewProcess

        protected void executeInNewProcess​(T config)
                                    throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createCommandBuilder

        protected org.wildfly.core.launcher.CliCommandBuilder createCommandBuilder​(T config,
                                                                                   Path scriptFile)
                                                                            throws IOException
        Throws:
        IOException
      • launchProcess

        protected int launchProcess​(org.wildfly.core.launcher.CliCommandBuilder builder,
                                    T config,
                                    StandardOutput stdout)
                             throws org.apache.maven.plugin.MojoExecutionException,
                                    IOException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        IOException