frysk.gui.monitor.observers
Class ProgramObserver

java.lang.Object
  extended by frysk.gui.monitor.GuiObject
      extended by frysk.gui.monitor.observers.ObserverRoot
          extended by frysk.gui.monitor.observers.TaskObserverRoot
              extended by frysk.gui.monitor.observers.ProgramObserver
All Implemented Interfaces:
SaveableXXX, Observer, TaskObserver, TaskObserver.Execed, TaskObserver.Forked

public class ProgramObserver
extends TaskObserverRoot
implements TaskObserver.Forked, TaskObserver.Execed

A ProgramObserver watches a process for fork events. If the process forks it watches the newly forked child for exec events when the new child has called exec it is added to the procs list. The procs lis is to be watched by clients interested in new procs spawning.


Nested Class Summary
 
Nested classes/interfaces inherited from interface frysk.proc.TaskObserver
TaskObserver.Cloned, TaskObserver.Code, TaskObserver.Execed, TaskObserver.Forked, TaskObserver.Instruction, TaskObserver.Signaled, TaskObserver.Syscalls, TaskObserver.Terminated, TaskObserver.Terminating, TaskObserver.Watch
 
Field Summary
(package private)  ObservableLinkedList procs
          A list of procs that have been discovered.
 
Fields inherited from class frysk.gui.monitor.observers.ObserverRoot
genericActionPoint
 
Fields inherited from class frysk.gui.monitor.GuiObject
propertiesChanged
 
Constructor Summary
ProgramObserver()
           
 
Method Summary
 void addedTo(Object observable)
          Acknowledge the request to add this Observer from Object's set of observers was successful.
 void addFailed(Object observable, Throwable w)
          Notify that the attempt to add to the specified observer failed.
 void apply(Task task)
           
 void deletedFrom(Object observable)
          Acknowledge the request to delete this Observer from Object's set of observers was successful (or that the Observer was spontaneously deleted, e.g., due to a task exit).
 ObservableLinkedList getProcsList()
          Get the ObservableLinkedList for procs.
 void unapply(Task task)
           
 void unwatchProc(Proc proc)
           
 Action updateExeced(Task task)
          Called AFTER the Task has execed.
 Action updateForkedOffspring(Task parent, Task offspring)
          Called when the Task (the offspring) that was created by a fork has stopped at its first instruction.
 Action updateForkedParent(Task parent, Task offspring)
          Called when the Task (the parent) has forked, creating a child Proc containing a single Task (the offspring).
 void watchProc(Proc proc)
           
 
Methods inherited from class frysk.gui.monitor.observers.TaskObserverRoot
apply, unapply
 
Methods inherited from class frysk.gui.monitor.observers.ObserverRoot
addActionPoint, addFilterPoint, getActionPoints, getBaseName, getCopy, getCurrentAction, getCurrentActionCombos, getCurrentFilterCombos, getFilterPoints, getInfo, load, runActions, save, setInfo, setReturnAction, whatActionShouldBeReturned
 
Methods inherited from class frysk.gui.monitor.GuiObject
dontSaveObject, doSaveObject, getName, getSummary, getToolTip, setName, setSummay, setToolTip, shouldSaveObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface frysk.gui.monitor.SaveableXXX
dontSaveObject, doSaveObject, shouldSaveObject
 

Field Detail

procs

ObservableLinkedList procs
A list of procs that have been discovered.

Constructor Detail

ProgramObserver

public ProgramObserver()
Method Detail

updateForkedParent

public Action updateForkedParent(Task parent,
                                 Task offspring)
Description copied from interface: TaskObserver.Forked
Called when the Task (the parent) has forked, creating a child Proc containing a single Task (the offspring). Return Action.BLOCK if the observer wants the parent task to block.

Specified by:
updateForkedParent in interface TaskObserver.Forked

updateForkedOffspring

public Action updateForkedOffspring(Task parent,
                                    Task offspring)
Description copied from interface: TaskObserver.Forked
Called when the Task (the offspring) that was created by a fork has stopped at its first instruction.

Specified by:
updateForkedOffspring in interface TaskObserver.Forked

addedTo

public void addedTo(Object observable)
Description copied from interface: Observer
Acknowledge the request to add this Observer from Object's set of observers was successful.

Specified by:
addedTo in interface Observer
Overrides:
addedTo in class TaskObserverRoot

addFailed

public void addFailed(Object observable,
                      Throwable w)
Description copied from interface: Observer
Notify that the attempt to add to the specified observer failed.

Specified by:
addFailed in interface Observer
Overrides:
addFailed in class ObserverRoot

deletedFrom

public void deletedFrom(Object observable)
Description copied from interface: Observer
Acknowledge the request to delete this Observer from Object's set of observers was successful (or that the Observer was spontaneously deleted, e.g., due to a task exit).

Specified by:
deletedFrom in interface Observer
Overrides:
deletedFrom in class TaskObserverRoot

updateExeced

public Action updateExeced(Task task)
Description copied from interface: TaskObserver.Execed
Called AFTER the Task has execed. Return Action.BLOCK if the observer wants the task to block.

Specified by:
updateExeced in interface TaskObserver.Execed

watchProc

public void watchProc(Proc proc)

unwatchProc

public void unwatchProc(Proc proc)

apply

public void apply(Task task)
Specified by:
apply in class TaskObserverRoot

unapply

public void unapply(Task task)
Specified by:
unapply in class TaskObserverRoot

getProcsList

public ObservableLinkedList getProcsList()
Get the ObservableLinkedList for procs. this can be watched in order to catch newly created procs

Returns: