|
JDeveloper SCM API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ide.scm.util.runner.SCMShellRunner
Class for the running of shell commands. This, along with the process wrapper and stream monitor adapters, provide convenience utilities for running external processes and accessing output.
Constructor Summary | |
SCMShellRunner()
Constructs a new shell runner. |
Method Summary | |
void |
addErrorMonitor(SCMStreamMonitor monitor)
Adds a process error stream monitor to the shell runner's list. |
void |
addOutputMonitor(SCMStreamMonitor monitor)
Adds a process output stream monitor to the shell runner's list. |
void |
clearMonitors()
Clears all process output and error monitors for the shell runner. |
protected java.lang.String[] |
createCommandSpi(java.lang.String[] cmdarray)
Implementation for command changes prior to execution. |
protected SCMProcess |
createProcess(java.lang.String[] cmdarray)
Runs the given command through Runtime , creating a new process. |
protected SCMProcess |
doExecSpi(java.lang.String[] cmdarray)
Implementation for command execution by process creation. |
SCMProcess |
exec()
Executes the configured command of this shell runner, spawning a process. |
java.lang.String[] |
getCmdArray()
Gets the command parts for this shell runner. |
java.util.List |
getCmdList()
Gets the command parts for this shell runner as a list. |
java.lang.String |
getCommand()
Gets the command string for this shell runner. |
java.io.File |
getDirectory()
Gets the working directory for the process. |
java.net.URL |
getDirURL()
Gets the working directory for the process from a URL. |
java.lang.String[] |
getEnvpArray()
Gets the environment variables for the process. |
java.util.Map |
getEnvpMap()
Gets the environment variables for the process in a map. |
protected java.util.List |
getErrorMonitors()
Gets the internal error monitor list. |
protected java.util.List |
getOutputMonitors()
Gets the internal output monitor list. |
java.lang.String |
getReadableCommand()
Builds a readable string for representing the command invocation. |
long |
getTimeout()
Gets the process activity timeout length, in milliseconds. |
boolean |
getUseNativeShell()
Asks whether the process will be run by a recognized native shell. |
boolean |
getUseWin32Console()
Asks whether a detached console wil be created for the new process. |
boolean |
isOutputBuffered()
Asks whether process output will be buffered. |
protected void |
postExecSpi(SCMProcess process)
Implementation for actions after the running of a command. |
protected void |
preExecSpi()
Implementation for actions prior to the running of a command. |
void |
removeErrorMonitor(SCMStreamMonitor monitor)
Removes a process error stream monitor from the shell runner's list. |
void |
removeOutputMonitor(SCMStreamMonitor monitor)
Removes a process output stream monitor from the shell runner's list. |
void |
setCmdArray(java.lang.String[] cmd_array)
Sets the command parts for this shell runner. |
void |
setCmdList(java.util.List cmd_list)
Sets the command parts for this shell runner from a list. |
void |
setCommand(java.lang.String command)
Sets the command string for this shell runner. |
void |
setDirectory(java.io.File dir)
Sets the working directory for the process. |
void |
setDirURL(java.net.URL dir)
Sets the working directory for the process from a URL. |
void |
setEnvpArray(java.lang.String[] envp_array)
Sets the environment variables for the process from an array. |
void |
setEnvpMap(java.util.Map envp_map)
Sets the environment variables for the process from a map. |
void |
setOutputBuffered(boolean buffered)
Sets whether process output will be buffered. |
void |
setTimeout(long timeout)
Sets the process activity timeout length, in milliseconds. |
void |
setUseNativeShell(boolean shell)
Sets whether the process will be run by a recognized native shell. |
void |
setUseWin32Console(boolean console)
Sets whether a detached console wil be created for the new process. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SCMShellRunner()
Method Detail |
public void setCommand(java.lang.String command)
command
- the shell runner's command.public void setCmdArray(java.lang.String[] cmd_array)
cmdarray
- the shell runner's command array.public void setCmdList(java.util.List cmd_list)
cmdlist
- the shell runner's command array.public void setEnvpArray(java.lang.String[] envp_array)
envp
- the environment variables, in the form name=value.public void setEnvpMap(java.util.Map envp_map)
envp
- the environment variables, in a map of names and values.public void setDirectory(java.io.File dir)
dir
- the working directory.public void setDirURL(java.net.URL dir)
dir
- the working directory, as a URL.public void addOutputMonitor(SCMStreamMonitor monitor)
monitor
- the stream monitor.public void removeOutputMonitor(SCMStreamMonitor monitor)
monitor
- the stream monitor.public void addErrorMonitor(SCMStreamMonitor monitor)
monitor
- the stream monitor.public void removeErrorMonitor(SCMStreamMonitor monitor)
monitor
- the stream monitor.public void clearMonitors()
public void setTimeout(long timeout)
timeout
- the length of the timeout, or a value <= 0 to indicate no timeout.public void setOutputBuffered(boolean buffered)
buffered
- a decision on the buffering of output.public void setUseNativeShell(boolean shell)
shell
- a decision on whether a recognized shell for the OS will be used.public void setUseWin32Console(boolean console)
console
- a decision on whether a console should be spawned (Win32).public java.lang.String getCommand()
public java.lang.String[] getCmdArray()
public java.util.List getCmdList()
public java.lang.String[] getEnvpArray()
public java.util.Map getEnvpMap()
public java.io.File getDirectory()
public java.net.URL getDirURL()
public long getTimeout()
public boolean isOutputBuffered()
public boolean getUseNativeShell()
public boolean getUseWin32Console()
public java.lang.String getReadableCommand()
public SCMProcess exec() throws SCMException
SCMException
- if an error occurred when running the command.protected java.lang.String[] createCommandSpi(java.lang.String[] cmdarray)
cmdarray
- the command, before modification.protected void preExecSpi() throws SCMException
protected SCMProcess doExecSpi(java.lang.String[] cmdarray) throws SCMException
cmdarray
- the command to run.SCMException
- if an error occurred when running the command.protected void postExecSpi(SCMProcess process) throws SCMException
process
- the newly created process.protected final SCMProcess createProcess(java.lang.String[] cmdarray) throws SCMException
Runtime
, creating a new process.cmdarray
- the command to run.SCMException
- if an error occurred when running the command.protected final java.util.List getOutputMonitors()
protected final java.util.List getErrorMonitors()
|
Copyright © 2002 Oracle Corporation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |