You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Emperor <Da...@gmx.net> on 2002/02/23 01:29:59 UTC

event classes

Hi,
 
Why is there no basic event class providing a sender and a timestamp?
Perhaps is an interface for unified event producer class missing too. I
would purpose the following interface/methods:
 
interface EventDispatcher
{
    public void addEventListener(EventListener listener);
    public void removeEventListener(EventListener listener);
}
 
and perhaps a default event dispatcher class that simply stores the
events in a Vector and provides a protected dispatchEvent method that
sends an event to all the registered listeners.
 
event programming is sooooo cool ;)
 
Nils

Re: event classes

Posted by Peter Donald <pe...@apache.org>.
On Sat, 23 Feb 2002 11:29, Emperor wrote:
> event programming is sooooo cool ;)

I am not so sure about that ;) I still have nightmares of trying to debug an 
eventbased system. There was an off by one error in the pipeline that only 
become apparent when there was greater than 1024 clients connected ... it was 
an absolute PITA to track down ;)

Other than debugging it is kool though and nice and easy to extend

-- 
Cheers,

Pete

*-----------------------------------------------------*
| For those who refuse to understand, no explanation  |
| will ever suffice. For those who refuse to believe, |
| no evidence will ever suffice.                      |
*-----------------------------------------------------*

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: event classes

Posted by Berin Loritsch <bl...@apache.org>.
Emperor wrote:
> Hi,
>  
> Why is there no basic event class providing a sender and a timestamp?
> Perhaps is an interface for unified event producer class missing too. I
> would purpose the following interface/methods:
>  
> interface EventDispatcher
> {
>     public void addEventListener(EventListener listener);
>     public void removeEventListener(EventListener listener);
> }
>  
> and perhaps a default event dispatcher class that simply stores the
> events in a Vector and provides a protected dispatchEvent method that
> sends an event to all the registered listeners.
>  
> event programming is sooooo cool ;)


There are a couple of reasons.

1) The event classes we have are not tied to JavaBeans framework.  This
    is good IMO.  Server requirements are not the same as client machine
    frameworks

2) It is assumed that you are going to create your mappings between
    event sources and EventListeners.

3) There is an EventPipeline interface that is used to help you in #2.
    The ThreadManager uses the EventPipeline to assign threads to the
    pipeline.

I agree that Event programming is cool.  However, due to time
constraints I haven't been able to complete what I started yet.



-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>