com.jn.langx.commandline.launcher.CommandLauncherProxy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of langx-java Show documentation
Show all versions of langx-java Show documentation
Java lang extensions for java6+, a supplement to , replacement of a Guava, commons-lang.
Core utilities, Collection utilities, IO utilities, Cache, Configuration library ...
package com.jn.langx.commandline.launcher;
import com.jn.langx.commandline.CommandLine;
import com.jn.langx.commandline.ProcessAdapter;
import java.io.IOException;
import java.util.Map;
/**
* A command launcher that proxies another command launcher. Sub-classes
* override exec(args, env, workdir)
*/
public abstract class CommandLauncherProxy extends LocalCommandLauncher {
public CommandLauncherProxy(final CommandLauncher launcher) {
myLauncher = launcher;
}
private final CommandLauncher myLauncher;
/**
* Launches the given command in a new process. Delegates this method to the
* proxied launcher
*
* @param cmd the command line to execute as an array of strings
* @param env the environment to set as an array of strings
* @throws IOException forwarded from the exec method of the command launcher
*/
@Override
public ProcessAdapter exec(final CommandLine cmd, final Map env)
throws IOException {
return myLauncher.exec(cmd, env);
}
}