ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Murdoch <adammurd...@apache.org>
Subject Re: [myrmidon] TaskListener and friends
Date Tue, 16 Apr 2002 12:48:07 GMT
On Tue, 16 Apr 2002 21:46, Peter Donald wrote:
> 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?

In general, a good plan - but I have some questions:

* How does an event get fired?  Who is allowed to fire events?  Can tasks?  
All services?  A single service?

* How does a listener get registered?  How does a task register a listener?  
Or an app?  Or a service?

* Are events scoped?  That is, are they visible outside the execution frame 
where they were fired in?  In parent frames?  Child frames?  Globally?  
Depends on the listener?

* How are events typed?  Are the types extensible?  Can we fire, say, 
'external command started' or 'type registered' events for inter-service 
communication?

-- 
Adam

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message