com.borland.jbuilder.runtime
Class JavaProcess
java.lang.Object
|
+--com.borland.jbuilder.runtime.JavaProcess
- public abstract class JavaProcess
- extends java.lang.Object
- implements java.awt.event.ActionListener
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
Periodically checks the progress of a running application. |
void |
addJavaProcessListener(JavaProcessListener listener)
Adds a listener to the list of listeners that receive events. |
void |
fireJavaProcessPaused()
Notifies all registered listeners that.... |
void |
fireJavaProcessResumed()
Notifies all registered listeners that the process this object represents
has resumed execution after being paused. |
void |
fireJavaProcessSent(java.lang.String text,
boolean error)
Notifies all registered listeners that the process this object represents
has produced output. |
void |
fireJavaProcessStarted()
Notifies all registered listeners that the process this object represents
has just begun execution. |
void |
fireJavaProcessStopped(int exitCode)
Notifies all registered listeners that the process this object represents
is no longer running. |
protected java.lang.String |
formatClasspath(java.lang.String classpath)
|
java.lang.String |
getCommandLine()
|
static java.lang.String |
getJavaLauncher()
|
abstract int |
getProcessExitCode()
|
protected java.lang.String |
insertVMParamOnLeft(java.lang.String vmParams,
java.lang.String newParam)
|
java.lang.Thread |
monitorOutput()
|
void |
readOutput()
Uses sendOutput to report output to both stderr and stdout
to listeners. |
void |
removeJavaProcessListener(JavaProcessListener listener)
Removes a listener from the list of listeners that receive events. |
void |
restart()
|
void |
sendInput(java.lang.String value)
|
void |
setCommandLine(java.lang.String commandLine)
|
protected int |
skipLeftOnlyParam(java.lang.String s)
|
void |
start(java.io.File jdkHome,
java.lang.String className,
java.lang.String classPath,
java.lang.String vmInsertedParams,
java.lang.String vmUserParams,
java.lang.String params)
|
abstract java.lang.Process |
startJavaProcess(java.io.File jdkHome,
java.lang.String className,
java.lang.String classPath,
java.lang.String vmInsertedParams,
java.lang.String vmUserParams,
java.lang.String params)
|
void |
stop()
|
abstract void |
stopJavaProcess()
|
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
STILL_RUNNING
public static final int STILL_RUNNING
leftOnlyVMParams
public static final GlobalProperty leftOnlyVMParams
JavaProcess
public JavaProcess()
startJavaProcess
public abstract java.lang.Process startJavaProcess(java.io.File jdkHome,
java.lang.String className,
java.lang.String classPath,
java.lang.String vmInsertedParams,
java.lang.String vmUserParams,
java.lang.String params)
stopJavaProcess
public abstract void stopJavaProcess()
getProcessExitCode
public abstract int getProcessExitCode()
start
public void start(java.io.File jdkHome,
java.lang.String className,
java.lang.String classPath,
java.lang.String vmInsertedParams,
java.lang.String vmUserParams,
java.lang.String params)
restart
public void restart()
stop
public void stop()
insertVMParamOnLeft
protected java.lang.String insertVMParamOnLeft(java.lang.String vmParams,
java.lang.String newParam)
skipLeftOnlyParam
protected int skipLeftOnlyParam(java.lang.String s)
formatClasspath
protected java.lang.String formatClasspath(java.lang.String classpath)
sendInput
public void sendInput(java.lang.String value)
readOutput
public void readOutput()
- Uses
sendOutput
to report output to both stderr and stdout
to listeners.
getJavaLauncher
public static java.lang.String getJavaLauncher()
getCommandLine
public java.lang.String getCommandLine()
setCommandLine
public void setCommandLine(java.lang.String commandLine)
addJavaProcessListener
public void addJavaProcessListener(JavaProcessListener listener)
- Adds a listener to the list of listeners that receive events.
- Parameters:
listener
- The listener.
removeJavaProcessListener
public void removeJavaProcessListener(JavaProcessListener listener)
- Removes a listener from the list of listeners that receive events.
- Parameters:
listener
- The listener.
fireJavaProcessStarted
public void fireJavaProcessStarted()
- Notifies all registered listeners that the process this object represents
has just begun execution.
- Parameters:
exitCode
- The exit code returned by the process when it was stopped.
fireJavaProcessStopped
public void fireJavaProcessStopped(int exitCode)
- Notifies all registered listeners that the process this object represents
is no longer running.
- Parameters:
exitCode
- The exit code returned by the process when it was stopped.
fireJavaProcessPaused
public void fireJavaProcessPaused()
- Notifies all registered listeners that.... BWS?
fireJavaProcessSent
public void fireJavaProcessSent(java.lang.String text,
boolean error)
- Notifies all registered listeners that the process this object represents
has produced output.
- Parameters:
text
- A string of characters emitted by the process, including
end of line characters as appropriate.error
- True if the text was sent to stderr, false if it was sent to
stdout.
fireJavaProcessResumed
public void fireJavaProcessResumed()
- Notifies all registered listeners that the process this object represents
has resumed execution after being paused.
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Periodically checks the progress of a running application. Transfers any
information sent to stdout and stderr to the appropriate view, and deals
with the termination of the process when it occurs.
- Specified by:
- actionPerformed in interface java.awt.event.ActionListener
- Parameters:
e
- Ignored.
monitorOutput
public java.lang.Thread monitorOutput()