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

Variable Index

 o ERROR_DATA
Events of type ProcessEvent.ERROR_DATA are generated when the Process writes data to its standard error stream.
 o EXITED
Events of type ProcessEvent.EXITED are generated when the Process terminates.
 o OUTPUT_DATA
Events of type ProcessEvent.OUTPUT_DATA are generated when the Process writes data to its standard output stream.

Constructor Index

 o ProcessEvent(Process, int)
Construct a ProcessEvent.

Method Index

 o getBytes()
Get the byte array associated with an OUTPUT_DATA or ERROR_DATA event.
 o getExitCode()
Get the exit code associated with an EXITED event.
 o getProcess()
Get the Process associated with this event.
 o setBytes(byte[])
Set the byte array associated with an OUTPUT_DATA or ERROR_DATA event.
 o setExitCode(int)
Set the exit code associated with an EXITED event.

Variables

 o 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.

 o 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.

 o 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.

Constructors

 o 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.

Methods

 o getProcess
 public Process getProcess()
Get the Process associated with this event.

Returns:
The Process associated with this event.
 o 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.
 o 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.
 o setExitCode
 public void setExitCode(int exitCode)
Set the exit code associated with an EXITED event.

Parameters:
exitCode - The Process exit code.
 o 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