Sigh, seems the way I thought interface worked isn't. I'll need to tweak the internals. If I understand Sami's comment correctly, having individual .requestAddTerminatingObserver et.al. interfaces would also be prefered?
having requestAddXObserver would catch mistakes at compile time, amongst other benefits yes.
Completly refactored, note though that I had some problems with the GUI code - I suspect some of the objects are missing interfaces. Index: frysk-core/frysk/proc/ChangeLog 2005-10-25 Andrew Cagney <cagney@redhat.com> * TaskObservable.java: New file. * TestTaskTerminateObserver.java, TestTaskForkedObserver.java, TestTaskClonedObserver.java, TestProcGet.java, TestModify.java: Update. * TestLib.java: Make .TaskObserverBase abstract adding .updateTask method; have it register itself as a task-added observer. Delete AddTaskObserver. * TaskState.java: Update .processRequestAddObserver, and .processRequestDeleteObserver to take a TaskObservable. * Task.java: Add .clonedObservers, .requestAddClonedObserver, requestDeleteClonedObserver, .attachedObservers, .requestAddAttachedObserver, .requestDeleteAttachedObserver, .forkedObservers, .requestAddForkedObserver, .requestDeleteForkedObserver, .terminatedObservers, .requestAddTerminatedObserver, .requestDeleteTerminatedObserver, .terminatingObservers, .requestAddTerminatingObserver, .requestDeleteTerminatingObserver, .execedObservers, .requestAddExecedObserver, .requestDeleteExecedObserver. Make .requestAddObserver, and .requestDeleteObserver private. Index: frysk-gui/frysk/gui/monitor/ChangeLog 2005-10-25 Andrew Cagney <cagney@redhat.com> * ActionPool.java: Replace calls to Task .requestAddObserver, and .requestDeleteObserver with either a call to .requestAddExecedObserver, .requestDeleteExecedObserver, .requestAddTerminatingObsever, .requestDeleteTerminatingObserver, .requestAddForkedObserver, .requestDeleteForkedObserver, .requestAddClonedObserver, .requestDeleteClonedObserver, or a RuntimeException throw.