All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sgi.sysadm.util.ProcessWatcher

java.lang.Object
   |
   +----com.sgi.sysadm.util.ProcessWatcher

public class ProcessWatcher
extends Object
ProcessWatcher spawns threads to deal with a running Process. Notifies ProcessListeners when input arrives or the Process exits.


Constructor Index

 o ProcessWatcher(Process)
Constructor.

Method Index

 o addProcessListener(ProcessListener)
Add a listener interested in ProcessEvents.
 o removeProcessListener(ProcessListener)
Remove a listener no longer interested in ProcessEvents.
 o startWatching()
Initiate monitoring of the process.

Constructors

 o ProcessWatcher
 public ProcessWatcher(Process proc)
Constructor.

Parameters:
proc - Process to watch.

Methods

 o addProcessListener
 public void addProcessListener(ProcessListener listener)
Add a listener interested in ProcessEvents. This method must be called before startWatching() is called.

Parameters:
listener - A listener interested in ProcessEvents.
 o removeProcessListener
 public synchronized void removeProcessListener(ProcessListener listener)
Remove a listener no longer interested in ProcessEvents.

Parameters:
listener - A listener previously interested in ProcessEvents.
 o startWatching
 public void startWatching()
Initiate monitoring of the process. A call to startWatching() indicates that all ProcessListeners have been added and they are ready to receive events.


All Packages  Class Hierarchy  This Package  Previous  Next  Index