Class CommandExecutorImpl
- java.lang.Object
-
- com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl
-
- All Implemented Interfaces:
CommandRunner
@Service @PerLookup @ContractsProvided({CommandRunner.class,CommandExecutorImpl.class}) public class CommandExecutorImpl extends Object implements CommandRunnerThis class implements the code to execute asadmin commands programatically- Author:
- bhavanishankar@dev.java.net, sanjeeb.sahoo@sun.com
-
-
Constructor Summary
Constructors Constructor Description CommandExecutorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CommandResultrun(String command, String... args)Execute an administrative command inGlassFishusing the supplied command arguments.voidsetTerse(boolean terse)Set the terse level.
-
-
-
Method Detail
-
run
public CommandResult run(String command, String... args)
Description copied from interface:CommandRunnerExecute an administrative command inGlassFishusing the supplied command arguments. Refer to GlassFish Administration Guide to know about the commands supported in GlassFish and their usage. Example: To add an additional http listener 9090 :commandRunner.run("create-http-listener", "--listenerport", "9090", "--listeneraddress", "0.0.0.0", "--defaultvs", "server", "--securityenabled", "false", "listener_id", "my-http-listener-1");asadmin commands also allow option values to be specified using '=', so the above example can be written as:commandRunner.run("create-http-listener", "--listenerport=9090", "--listeneraddress=0.0.0.0", "--defaultvs=server", "--securityenabled=false", "listener_id=my-http-listener-1");- Specified by:
runin interfaceCommandRunner- Parameters:
command- command to be executed.args- command arguments.- Returns:
CommandResultwhich encapsulates exit status, command output, failure cause (if any).
-
setTerse
public void setTerse(boolean terse)
Description copied from interface:CommandRunnerSet the terse level. If true, output data is very concise and in a format that is optimized for use in programs instead of for reading by humans. Typically, descriptive text and detailed status messages are also omitted from the output data. Default is true.- Specified by:
setTersein interfaceCommandRunner- Parameters:
terse- true to get concise output, false otherwise.
-
-