frysk.proc
Class ProcTasksAction

java.lang.Object
  extended by frysk.proc.ProcTasksAction
All Implemented Interfaces:
Observer, TaskObserver, TaskObserver.Cloned, TaskObserver.Terminated

public final class ProcTasksAction
extends Object
implements TaskObserver.Cloned, TaskObserver.Terminated

Provides a mechanism for tracing all clone events within a process. Notifies a ProcObserver.ProcTasks of any tasks added to or deleted from that process.


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
private static Log fine
           
private  boolean isMainTaskAdded
           
private  Task mainTask
           
private  Proc proc
           
private  ProcTasksObserver procTasksObserver
           
 
Constructor Summary
ProcTasksAction(Proc theProc, ProcTasksObserver theProcTasksObserver)
          An observer that monitors all Tasks of a process notifying the caller of each new Task as it is added.
 
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 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).
private  void requestAddObservers(Task task)
           
 Action updateClonedOffspring(Task parent, Task offspring)
          When ever a new cloned offspring appears notify the observer, and add a cloned observer to it.
 Action updateClonedParent(Task parent, Task offspring)
          Called when the Task (the parent) has cloned, creating a clone Task (the offspring).
 Action updateTerminated(Task task, Signal signal, int value)
          Called once the Task has terminated; the process no longer exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fine

private static final Log fine

proc

private final Proc proc

procTasksObserver

private final ProcTasksObserver procTasksObserver

mainTask

private Task mainTask

isMainTaskAdded

private boolean isMainTaskAdded
Constructor Detail

ProcTasksAction

public ProcTasksAction(Proc theProc,
                       ProcTasksObserver theProcTasksObserver)
An observer that monitors all Tasks of a process notifying the caller of each new Task as it is added.

Method Detail

requestAddObservers

private void requestAddObservers(Task task)

updateClonedParent

public Action updateClonedParent(Task parent,
                                 Task offspring)
Description copied from interface: TaskObserver.Cloned
Called when the Task (the parent) has cloned, creating a clone Task (the offspring). Return Action.BLOCK if this observer wants the parent Task to block.

Specified by:
updateClonedParent in interface TaskObserver.Cloned

updateClonedOffspring

public Action updateClonedOffspring(Task parent,
                                    Task offspring)
When ever a new cloned offspring appears notify the observer, and add a cloned observer to it.

Specified by:
updateClonedOffspring in interface TaskObserver.Cloned

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

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

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

updateTerminated

public Action updateTerminated(Task task,
                               Signal signal,
                               int value)
Description copied from interface: TaskObserver.Terminated
Called once the Task has terminated; the process no longer exists. If SIGNAL is non-NULL it is the signal causing the termination, else STATUS is the exit value passed to _exit(2).

Specified by:
updateTerminated in interface TaskObserver.Terminated