RE: DefaultDispatchQueue implementation problem

"Christian Cryder" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Hi Thorsten,

Ok, I understand the issue you are describing, but I don't actually think
its behaving wrongly...I just don't think that method was meant to be used
the way you are trying to do. Can you tell me exactly what you are trying to
accomplish here?

It _sounded like_ you are trying to figure out whether the event was invoked
directly, or whether a child event was actually fired. Is that the case? Or
is there something else going on?

Help me understand exactly what you are trying to achieve, and we'll either
tell you how to do it, or modify Barracuda as needed.

Christian
----------------------------------------------
Christian Cryder
Internet Architect, ATMReports.com
Project Chair, BarracudaMVC - http://barracudamvc.org
----------------------------------------------
"Coffee? I could quit anytime, just not today"


> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]]On Behalf Of Thorsten Möller
> Sent: Thursday, September 25, 2003 4:53 PM
> To: [email protected]
> Subject: [Barracuda] DefaultDispatchQueue implementation problem
>
>
> Hi!
>
> After some hours of debugging I found out that there is a really
> bad design
> problem with the implementation of
> DefaultEventQueue.listRemainingEvents().
> Let me explain. Suppose you have a event hierarchy like this:
>
> <req-events>
>     <event name="Level0">
>         <event name="Level1">
>             <event name="Level2">
>                 <event name="Level3a"/>
>                 <event name="Level3b"/>
>             </event>
>         </event>
>     </event>
> </req-events>
>
> When there is a call to event "Level3a" the event processing starts with
> event "Level0". The events "Level1", "Level2" and "Level3a" also remain to
> get processed. So far so good. My event handler listening on
> "Level0" events
> looks like this:
>
> public void handleControlEvent(ControlEventContext context) throws
> EventException, ServletException, IOException
> {
>     ...
>     if (context.getQueue().listRemainingEvents().size() == 0)
>     {
>         // inside code will always get executed since size is always 0 no
> matter if there was a direct call
>         // on this event or on child events
>     }
>     ...
> }
>
> But, as the name "listRemainingEvents" suggests, the method
> should return a
> list with 3 elements: Level1, Level2 and Level3a or to be precise: only a
> call on event Level0 should return an empty List, likewise a call on event
> Level2 should return a list with two elements (Level1 and Level2).
> Please note that I only talked about the event handler which listens on
> Level0 events and the assumption that there are no other events (view or
> whatever) on the queue.
> To sum up the problem: in my opinion the implementation of
> listRemainingEvents is wrong and should immediately changed the way I
> described. If that's not possible at least a new method should be added.
>
>
> Regards
> Thorsten
>
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.