|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.runner.SimpleProcess
The SimpleProcess class contains methods to start a process and redirect the process's output to the log window.
Constructor Summary | |
SimpleProcess()
Constructor. |
|
SimpleProcess(SimpleProcess process)
Copy constructor. |
|
SimpleProcess(java.lang.String[] cmd)
Creates an instance that can be used to start a subprocess. |
Method Summary | |
java.lang.Object |
clone()
Creates a clone instance of the process configuration. |
protected java.lang.Object |
copyTo(java.lang.Object o)
|
java.io.PipedInputStream |
duplicateErrorStream()
Returns a PipedInputStream which duplicates the error (System.err) from the subprocess. |
java.io.PipedInputStream |
duplicateOutputStream()
Returns a PipedInputStream which duplicates the output (System.out) from the subprocess. |
void |
exec()
Executes a separate subprocess. |
int |
execAndWait()
Executes a separate subprocess and waits for the subprocess to finish. |
java.lang.Exception |
getExecException()
Gets the exception that occurred when starting the process. |
RunProcess |
getRunProcess()
Gets the RunProcess instance used by this process
configuration. |
void |
setAddToProcessesFolder(boolean addToProcessesFolder)
Specifies whether to add the subprocess to the processes folder of the run manager. |
void |
setAddToTerminateMenu(boolean addToTerminateMenu)
Specifies whether to list the subprocess in the Terminate submenu of the Run menu. |
void |
setAllowInput(boolean allowInput)
Sets whether the subprocess will allow input, which will be read through some UI in the log window. |
void |
setCommand(java.lang.String[] cmd)
Sets the command for the subprocess. |
void |
setCommandStringForLog(java.lang.String commandStringForLog)
Specifies the command string that should be logged. |
void |
setEnvironmentParams(java.lang.String[] environmentParams)
Sets the environment parameters for the subprocess. |
void |
setIcon(javax.swing.Icon icon)
Sets the icon that will appear with the subprocess in the processes folder of the run manager. |
void |
setLabel(java.lang.String label)
Sets the label that will appear with the subprocess in the processes folder of the run manager. |
void |
setLogCommandString(boolean logCommandString)
Specifies whether to show the command string itself in the log window. |
void |
setLogPage(LogPage logPageOverride)
Sets the log page where the subprocess's output will be displayed. |
void |
setLogStartDirectory(boolean logStartDirectory)
Specifies whether to show the start directory in the log window. |
void |
setRunProcessListener(RunProcessListener runProcessListener)
Specifies that a callback method should be called after the subprocess has finished executing and all of the subprocess's output has been sent to the log page. |
void |
setShowStartStatus(boolean showStartStatus)
Specifies whether to show the start message in the status bar. |
void |
setUseLogPage(boolean useLogPage)
Sets whether a log page will be used to print process information. |
void |
setWorkingDirectory(java.io.File dir)
Sets the working directory for the subprocess. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleProcess()
public SimpleProcess(SimpleProcess process)
public SimpleProcess(java.lang.String[] cmd)
The subprocess inherits the working directory of the current
process, unless overridden by the
setWorkingDirectory(java.io.File)
method.
The label that will appear with the subprocess in the processes
folder of the run manager will be the zero-th argument of the
command array passed to the exec()
or execAndWait()
method, unless overridden by the setLabel(java.lang.String)
method.
The Swing default icon will appear with the subprocess in the
processes folder of the run manager, unless overridden by the
setIcon(javax.swing.Icon)
method.
A new log page will be created to display the subprocess's output,
unless overridden by the setLogPage(oracle.ide.log.LogPage)
method.
The start directory will be logged, unless overridden by the
setLogStartDirectory(boolean)
method.
The command string itself will be logged, unless overridden by the
setLogCommandString(boolean)
method.
To adjust or manipulate the command string that is logged,
use the setCommandStringForLog(java.lang.String)
method.
A start message will be shown in the status bar, unless overridden by the
setShowStartStatus(boolean)
method.
The subprocess will be added to the processes folder of the run
manager, unless overridden by the setAddToProcessesFolder(boolean)
method.
The subprocess will be listed in the Terminate submenu of the Run
menu, unless overridden by the setAddToTerminateMenu(boolean)
method.
cmd
- array containing the command to call and its arguments.Method Detail |
protected java.lang.Object copyTo(java.lang.Object o)
public RunProcess getRunProcess()
RunProcess
instance used by this process
configuration.
RunProcess
.public void setCommand(java.lang.String[] cmd)
cmd
- the command array.public void setEnvironmentParams(java.lang.String[] environmentParams)
environmentParams
- an array of strings, each element of which has
environment variable settings in format name=value, or null
if the subprocess should inherit the environment settings of the current
process.public void setUseLogPage(boolean useLogPage)
useLogPage
- if true, a log page will be used.public void setAllowInput(boolean allowInput)
allowInput
- if true, input will be read, otherwise, input
will not be read. Default value is false.public void setWorkingDirectory(java.io.File dir)
dir
- the working directory of the subprocess, or null if the
subprocess should inherit the working directory of the current
process.public void setLabel(java.lang.String label)
setLogPage(oracle.ide.log.LogPage)
method.
label
- the labelpublic void setIcon(javax.swing.Icon icon)
setLogPage(oracle.ide.log.LogPage)
method.
icon
- the iconpublic void setLogPage(LogPage logPageOverride)
public void setLogStartDirectory(boolean logStartDirectory)
public void setLogCommandString(boolean logCommandString)
public void setCommandStringForLog(java.lang.String commandStringForLog)
public void setShowStartStatus(boolean showStartStatus)
public void setAddToProcessesFolder(boolean addToProcessesFolder)
public void setAddToTerminateMenu(boolean addToTerminateMenu)
public void setRunProcessListener(RunProcessListener runProcessListener)
runProcessListener
- the run process listenerpublic java.io.PipedInputStream duplicateOutputStream()
public java.io.PipedInputStream duplicateErrorStream()
public void exec()
The standard output and error output streams are redirected to a page in the log window.
public int execAndWait()
The standard output and error output streams are redirected to a page in the log window.
public java.lang.Object clone()
public java.lang.Exception getExecException()
null
if no exception was thrown.
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.