ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject [myrmidon] TaskListener and friends
Date Tue, 16 Apr 2002 11:46:36 GMT

This extracted from other thread

> We also need to decide how listeners are going to work.  We should probably
> move them out of workspace, and generalise into some kind of event
> infrastructure.

I have been working on this a few days ago bu haven't really committed 
anytjhing atm. Basically I added a "o.a.myrmidon.api.event" package that 
contains basically the following

  String path; 
  String name; //aka shortname
  String location; //give location in physical medium contianed in
  String message;
  Throwable throwable;
  int processID; 

interface TaskListener
  void taskEvent(TaskEvent te);

Ignore processID for the moment as it is tied into something else I am working 
on to allow us to have "Java Processes" that are mostly isolated from each 
other (as long as you don't load native libraries).

The "path" element in even gives the path to this event. The "name" is the 
enclosing "element" in which the event was generated (usually a task). For 
instance the event 

{ "/ant/compile", "javac", "build.xml:20:13", "Compile success", null, 0 }

Saids that a message "Compile success" was generated by the javac task in the 
compile target which is in the ant project. The physical location translating 
to "build.xml:20:13"

The AbstractProjectListener would then just be a layer on top of TaskListener 
that translates the TaskEvents into the easier to digest ProjectListener 
interface. It would also mean that all of the project listener stuff could be 
put into framework layer rather than API layer (yay!!!).



Peter Donald

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message