frysk.gui.monitor.observers
Class ObserverRoot

java.lang.Object
  extended by frysk.gui.monitor.GuiObject
      extended by frysk.gui.monitor.observers.ObserverRoot
All Implemented Interfaces:
SaveableXXX, Observer, TaskObserver
Direct Known Subclasses:
TaskObserverRoot

public class ObserverRoot
extends GuiObject
implements TaskObserver, SaveableXXX

A more sophisticated implementer of Observer. provides name and tool tip strings for GUI display purposes. Takes Action objects that can be used by clients to customize behaviour.


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  ObservableLinkedList actionPoints
           
private  ObservableLinkedList actions
           
private  String baseName
           
private  ObservableLinkedList filterPoints
           
 GenericActionPoint genericActionPoint
           
private  String info
           
private  Action returnAction
           
 
Fields inherited from class frysk.gui.monitor.GuiObject
propertiesChanged
 
Constructor Summary
protected ObserverRoot()
           
protected ObserverRoot(ObserverRoot other)
           
protected ObserverRoot(String name, String toolTip)
           
 
Method Summary
protected  void addActionPoint(ActionPoint actionPoint)
           
 void addedTo(Object observable)
          Acknowledge the request to add this Observer from Object's set of observers was successful.
 void addFailed(Object o, Throwable w)
          Notify that the attempt to add to the specified observer failed.
protected  void addFilterPoint(FilterPoint filterPoint)
           
 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 getActionPoints()
           
 String getBaseName()
           
protected  GuiObject getCopy()
           
 Action getCurrentAction()
           
 ObservableLinkedList getCurrentActionCombos()
          Returns combo objects representing the currently applied actions.
 ObservableLinkedList getCurrentFilterCombos()
          Returns combo objects representing the currently applied filters.
 ObservableLinkedList getFilterPoints()
           
 String getInfo()
          Could be called by an action during the update call to get print generic information about the event that just occurred format (as currently used by logger): PID 123 did action ACTION on Host HOST
 void load(Element node)
          To load a stored property one does this: String someString = node.getAttributeValue("someString"); To load @link frysk.gui.monitor.SaveableXXX one gets the appropriet node and tells that object to load itself from that node.
private  Action loadReturnAction(Element node)
           
protected  void runActions()
           
 void save(Element node)
          Save object to the given node Saving Conventions: If this object has a property such as a String, char, int, etc, that is saved by using node.setAttribute("someProperty", someProperty); If this object contains composing @link frysk.gui.monitor.SaveableXXX then a node is created for that and that object is told to save itself to that node.
private  void saveReturnAction(Element node)
           
protected  void setInfo(String info)
          Should be called whent the observer has fired.
 void setReturnAction(Action action)
          Used to set which action is taken by the observer with respect to resuming execution of the observed thread after all the actions are executed.
protected  Action whatActionShouldBeReturned()
          Should be used by inheriting observers to get the desired Action with respect to stoping/resumeing execution of the observed thread.
 
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

actions

private ObservableLinkedList actions

info

private String info

filterPoints

private ObservableLinkedList filterPoints

actionPoints

private ObservableLinkedList actionPoints

baseName

private final String baseName

genericActionPoint

public GenericActionPoint genericActionPoint

returnAction

private Action returnAction
Constructor Detail

ObserverRoot

protected ObserverRoot()

ObserverRoot

protected ObserverRoot(String name,
                       String toolTip)

ObserverRoot

protected ObserverRoot(ObserverRoot other)
Method Detail

addFailed

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

Specified by:
addFailed in interface Observer

getInfo

public String getInfo()
Could be called by an action during the update call to get print generic information about the event that just occurred format (as currently used by logger): PID 123 did action ACTION on Host HOST


setInfo

protected void setInfo(String info)
Should be called whent the observer has fired. Every time this is called it sends a message to the logs, so it should only be called once every time the information changes

Parameters:
info - info string to be set

runActions

protected void runActions()

getFilterPoints

public ObservableLinkedList getFilterPoints()

getActionPoints

public ObservableLinkedList getActionPoints()

addFilterPoint

protected void addFilterPoint(FilterPoint filterPoint)

addActionPoint

protected void addActionPoint(ActionPoint actionPoint)

getBaseName

public String getBaseName()

saveReturnAction

private void saveReturnAction(Element node)

loadReturnAction

private Action loadReturnAction(Element node)

save

public void save(Element node)
Description copied from interface: SaveableXXX
Save object to the given node Saving Conventions: If this object has a property such as a String, char, int, etc, that is saved by using node.setAttribute("someProperty", someProperty); If this object contains composing @link frysk.gui.monitor.SaveableXXX then a node is created for that and that object is told to save itself to that node. Example: Element filtersNode = new Element("filtersList"); this.filtersList.save(filtersNode); node.addContent(filtersNode); Be careful some times one wants to save the objects name rather than the object itself, and then use the name to later recreate that object via a managers. Like observers for instance. Perhaps objects such as these should be smart enough to use a manager to save/load themselves, that way an api client doesnt have to worry ... one day :).

Specified by:
save in interface SaveableXXX
Overrides:
save in class GuiObject

load

public void load(Element node)
Description copied from interface: SaveableXXX
To load a stored property one does this: String someString = node.getAttributeValue("someString"); To load @link frysk.gui.monitor.SaveableXXX one gets the appropriet node and tells that object to load itself from that node. Example: Element filtersNode = node.getChild("filtersList"); this.filtersList.load(filtersNode);

Specified by:
load in interface SaveableXXX
Overrides:
load in class GuiObject

getCopy

protected GuiObject getCopy()
Overrides:
getCopy in class GuiObject

getCurrentFilterCombos

public ObservableLinkedList getCurrentFilterCombos()
Returns combo objects representing the currently applied filters.

Returns:
List of combos.
See Also:
Combo.

getCurrentActionCombos

public ObservableLinkedList getCurrentActionCombos()
Returns combo objects representing the currently applied actions.

Returns:
List of combos.
See Also:
Combo.

setReturnAction

public void setReturnAction(Action action)
Used to set which action is taken by the observer with respect to resuming execution of the observed thread after all the actions are executed. acceptable values are Action.BLOCK to block the process. Action.CONTINUE to continue the process. and null to pop-up a dialog and ask the user for action.


whatActionShouldBeReturned

protected Action whatActionShouldBeReturned()
Should be used by inheriting observers to get the desired Action with respect to stoping/resumeing execution of the observed thread.

Returns:

getCurrentAction

public Action getCurrentAction()

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

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