|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.norconex.jef.exec.ExecUtils
public final class ExecUtils
Utility methods related to process execution.
Field Summary | |
---|---|
static String |
STDERR
Identifier for standard error. |
static String |
STDOUT
Identifier for standard output. |
Method Summary | |
---|---|
static int |
watchProcess(Process process)
Watches a running process. |
static int |
watchProcess(Process process,
IStreamListener listener)
Watches a running process. |
static int |
watchProcess(Process process,
IStreamListener[] listeners)
Watches a running process. |
static int |
watchProcess(Process process,
IStreamListener[] outputListeners,
IStreamListener[] errorListeners)
Watches a running process. |
static int |
watchProcess(Process process,
IStreamListener outputListener,
IStreamListener errorListener)
Watches a running process. |
static void |
watchProcessOutput(Process process,
IStreamListener[] outputListeners,
IStreamListener[] errorListeners)
Watches process output. |
static void |
watchProcessOutput(Process process,
IStreamListener outputListener,
IStreamListener errorListener)
Watches process output. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String STDOUT
public static final String STDERR
Method Detail |
---|
public static int watchProcess(Process process) throws InterruptedException
StreamGobbler
to read its error and output stream.
process
- the process to watch
InterruptedException
- problem while waiting for process to finishpublic static int watchProcess(Process process, IStreamListener listener) throws InterruptedException
StreamGobbler
to read its error and output stream.
The listener will be notified every time an error or output line
gets written by the process.
The listener line type will either be "STDERR" or "STDOUT".
process
- the process to watchlistener
- the listener to use for both "STDERR" or "STDOUT".
InterruptedException
- problem while waiting for process to finishpublic static int watchProcess(Process process, IStreamListener[] listeners) throws InterruptedException
StreamGobbler
to read its error and output stream.
The listener will be notified every time an error or output line
gets written by the process.
The listener line type will either be "STDERR" or "STDOUT".
process
- the process to watchlisteners
- the listeners to use for both "STDERR" or "STDOUT".
InterruptedException
- problem while waiting for process to finishpublic static int watchProcess(Process process, IStreamListener outputListener, IStreamListener errorListener) throws InterruptedException
StreamGobbler
to read its error and output stream.
The listener will be notified every time an error or output line
gets written by the process.
The listener line type will either be "STDERR" or "STDOUT".
process
- the process to watchoutputListener
- the process output listenererrorListener
- the process error listener
InterruptedException
- problem while waiting for process to finishpublic static int watchProcess(Process process, IStreamListener[] outputListeners, IStreamListener[] errorListeners) throws InterruptedException
StreamGobbler
to read its error and output stream.
The listeners will be notified every time an error or output line
gets written by the process.
The listener line type will either be "STDERR" or "STDOUT".
process
- the process to watchoutputListeners
- the process output listenerserrorListeners
- the process error listeners
InterruptedException
- problem while waiting for process to finishpublic static void watchProcessOutput(Process process, IStreamListener outputListener, IStreamListener errorListener)
watchProcess(Process, IStreamListener, IStreamListener)
with the exception of not waiting for the process to complete before
returning.
process
- the process on which to watch outputsoutputListener
- the process output listenerserrorListener
- the process error listenerspublic static void watchProcessOutput(Process process, IStreamListener[] outputListeners, IStreamListener[] errorListeners)
watchProcess(Process, IStreamListener[], IStreamListener[])
with the exception of not waiting for the process to complete before
returning.
process
- the process on which to watch outputsoutputListeners
- the process output listenerserrorListeners
- the process error listeners
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |