org.jppf.process
Class ProcessWrapper
java.lang.Object
org.jppf.utils.EventEmitter<ProcessWrapperEventListener>
org.jppf.process.ProcessWrapper
public final class ProcessWrapper
- extends EventEmitter<ProcessWrapperEventListener>
Wrapper around an external process started with ProcessBuilder.
Instances of this class read the output ands error streams generated by the process and provide
a notification mechanism with separate events for the respective streams.
- Author:
- Laurent Cohen
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProcessWrapper
public ProcessWrapper()
- Initialize this process handler.
ProcessWrapper
public ProcessWrapper(Process process)
- Initialize this process handler with the specified process.
- Parameters:
process - the process to handle.
getProcess
public Process getProcess()
- Get the process to handle.
- Returns:
- a
Process instance.
setProcess
public void setProcess(Process process)
- Set the process to handle.
If the process has already been set through this setter or the corresponding contructor, this method does nothing.
- Parameters:
process - - a Process instance.
fireStreamEvent
protected void fireStreamEvent(boolean output,
String content)
- Notify all listeners that a stream event has occurred.
- Parameters:
output - true if the event is for the outpuit stream, false if it is for the error stream.content - the text that written to the stream.
Copyright © 2005-2010 JPPF Team.