frysk.rt
Class ProcTaskIDManager

java.lang.Object
  extended by frysk.rt.ProcTaskIDManager
All Implemented Interfaces:
Observer, TaskObserver, TaskObserver.Cloned, TaskObserver.Forked, TaskObserver.Terminated

public class ProcTaskIDManager
extends Object
implements TaskObserver.Cloned, TaskObserver.Forked, TaskObserver.Terminated


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
 
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 clearProcIDs()
           
 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).
 int getNumberOfProcs()
           
 int getNumberOfTasks(int procID)
           
 Proc getProc(int id)
           
 int getProcID(Proc proc)
           
static ProcTaskIDManager getSingleton()
           
 Task getTask(int procID, int taskID)
           
 void manageProc(Proc proc, int reservedID)
           
 void removeProc(int procID)
          removeProc removes a proc and its associated tasks by setting this particular procID to null
 int reserveProcID()
           
 ArrayList snapshot()
           
 Action updateClonedOffspring(Task parent, Task offspring)
          Called when the Task (the offspring) that was created by a fork has stopped at its first instruction.
 Action updateClonedParent(Task parent, Task offspring)
          Called when the Task (the parent) has cloned, creating a clone Task (the offspring).
 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).
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

reserveProcID

public int reserveProcID()

manageProc

public void manageProc(Proc proc,
                       int reservedID)

getProc

public Proc getProc(int id)

getProcID

public int getProcID(Proc proc)

clearProcIDs

public void clearProcIDs()

getNumberOfProcs

public int getNumberOfProcs()

getNumberOfTasks

public int getNumberOfTasks(int procID)

getTask

public Task getTask(int procID,
                    int taskID)

removeProc

public void removeProc(int procID)
removeProc removes a proc and its associated tasks by setting this particular procID to null

Parameters:
procID -

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

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

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)
Description copied from interface: TaskObserver.Cloned
Called when the Task (the offspring) that was created by a fork has stopped at its first instruction.

Specified by:
updateClonedOffspring in interface TaskObserver.Cloned

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

getSingleton

public static ProcTaskIDManager getSingleton()

snapshot

public ArrayList snapshot()