Hi,
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
TaskEvent
{
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!!!).
Thoughts?
--
Cheers,
Peter Donald
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>