Package org.dellroad.jct.core.simple
Class SimpleExec
java.lang.Object
org.dellroad.jct.core.simple.SimpleCommandSupport
org.dellroad.jct.core.simple.SimpleExec
- All Implemented Interfaces:
Exec
A simple implementation of the
Exec
interface using a library of SimpleCommand
s.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
DefaultExecSession
implementation used bySimpleExec
.Nested classes/interfaces inherited from class org.dellroad.jct.core.simple.SimpleCommandSupport
SimpleCommandSupport.FoundCommand
-
Field Summary
Fields inherited from class org.dellroad.jct.core.simple.SimpleCommandSupport
commandBundles, commandLineParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnewExecSession
(ExecRequest request) Create a new non-interactive console session in which to execute a single command.newExecSession
(ExecRequest request, SimpleCommandSupport.FoundCommand command) Alternate ssession creator for when the command line is already parsed and a command is already identified.Methods inherited from class org.dellroad.jct.core.simple.SimpleCommandSupport
buildCommandMap, findCommand, findCommand, findCommand, getCommandBundles, getCommandLineParser, setCommandLineParser
-
Constructor Details
-
SimpleExec
public SimpleExec()
-
-
Method Details
-
newExecSession
Description copied from interface:Exec
Create a new non-interactive console session in which to execute a single command.If the request fails, this method should return null and write an error message to
request.
getErrorStream()
.- Specified by:
newExecSession
in interfaceExec
- Parameters:
request
- command request- Returns:
- non-interactive session, or null on failure
- Throws:
IOException
- if an I/O error occurs
-
newExecSession
public ExecSession newExecSession(ExecRequest request, SimpleCommandSupport.FoundCommand command) throws IOException Alternate ssession creator for when the command line is already parsed and a command is already identified.- Parameters:
request
- session requestcommand
- command to execute- Returns:
- new session
- Throws:
IOException
- if an I/O error occursIllegalArgumentException
- if any parameter is null
-