All Packages Class Hierarchy This Package Previous Next Index
Class com.sgi.sysadm.util.ProcessEvent
java.lang.Object
|
+----java.util.EventObject
|
+----com.sgi.sysadm.util.ProcessEvent
- public class ProcessEvent
- extends EventObject
ProcessEvent is an event generated by a ProcessWatcher in response to
the activities of a Process.
- See Also:
- Process, ProcessListener, ProcessWatcher
-
ERROR_DATA
- Events of type ProcessEvent.ERROR_DATA are generated when the Process
writes data to its standard error stream.
-
EXITED
- Events of type ProcessEvent.EXITED are generated when the Process
terminates.
-
OUTPUT_DATA
- Events of type ProcessEvent.OUTPUT_DATA are generated when the Process
writes data to its standard output stream.
-
ProcessEvent(Process, int)
- Construct a ProcessEvent.
-
getBytes()
- Get the byte array associated with an OUTPUT_DATA or ERROR_DATA
event.
-
getExitCode()
- Get the exit code associated with an EXITED event.
-
getProcess()
- Get the Process associated with this event.
-
setBytes(byte[])
- Set the byte array associated with an OUTPUT_DATA or ERROR_DATA event.
-
setExitCode(int)
- Set the exit code associated with an EXITED event.
OUTPUT_DATA
public static final int OUTPUT_DATA
- Events of type ProcessEvent.OUTPUT_DATA are generated when the Process
writes data to its standard output stream. Use ProcessEvent.getBytes()
to get the output data.
ERROR_DATA
public static final int ERROR_DATA
- Events of type ProcessEvent.ERROR_DATA are generated when the Process
writes data to its standard error stream. Use ProcessEvent.getBytes()
to get the error data.
EXITED
public static final int EXITED
- Events of type ProcessEvent.EXITED are generated when the Process
terminates. Use ProcessEvent.getExitCode() to get the exit code.
ProcessEvent
public ProcessEvent(Process source,
int type)
- Construct a ProcessEvent.
- Parameters:
- source - Process associated with this event.
- type - Type of event. One of ProcessEvent.OUTPUT_DATA,
ProcessEvent.ERROR_DATA, or ProcessEvent.EXITED.
getProcess
public Process getProcess()
- Get the Process associated with this event.
- Returns:
- The Process associated with this event.
setBytes
public void setBytes(byte bytes[])
- Set the byte array associated with an OUTPUT_DATA or ERROR_DATA event.
- Parameters:
- bytes - The array of bytes generated by the Process.
getBytes
public byte[] getBytes()
- Get the byte array associated with an OUTPUT_DATA or ERROR_DATA
event. Will call Log.fail() if the event is of the wrong type.
- Returns:
- The array of bytes generated by the Process.
setExitCode
public void setExitCode(int exitCode)
- Set the exit code associated with an EXITED event.
- Parameters:
- exitCode - The Process exit code.
getExitCode
public int getExitCode()
- Get the exit code associated with an EXITED event. Will call
Log.fail() if the event is of the wrong type.
- Returns:
- The Process exit code.
All Packages Class Hierarchy This Package Previous Next Index