com.tirsen.angkor.event
Class EventQueue
java.lang.Object
|
+--com.tirsen.angkor.event.EventQueue
- public class EventQueue
- extends java.lang.Object
The EventQueue is used to schedule the sending of events until just before the render-phase.
This is to ensure that all models have been updated before event-processing.
Q: with the new model with separated smaller components there are several parse and render-phases
this means that the events will only be queued up for each component. This might prove to be acceptable
though.
A: This is resolved for the following reason, during the render phase components are registered for parsing
when the request returns the ApplicationFilter starts the parse phase which ends with the RenderContext resetting
the list of registered parsing components, when the RenderContext is ready with this the ApplicationFilter
passes the request to the FilterChain. This means that all components from the previous request are parsed before
the jsps or components are rendered.
Q: In what order are events sent?
A: Events can not be ordered in the same sense as in a Swing application when it comes to a web application.
Therefor some kind of guessing needs to be applied to in what order events are to be processed. A pre-defined
ordering of events are applied. This could be: ViewLinkEvent, , ActionEvent.
- Version:
- $Revision: 1.4 $
$Id: EventQueue.java,v 1.4 2002/10/13 13:37:26 tirsen Exp $
- Author:
- $Author: tirsen $
Method Summary |
java.util.Iterator |
iterateEvents()
Returns a thread safe iterator over the current events. |
void |
postEvent(java.lang.Class listenerInterface,
java.util.EventListener target,
java.util.EventObject event,
java.lang.String method)
Currently does not queue up events to be sent later on. |
void |
processEvents(Application application)
Sends the events and clears the event queue. |
void |
reset()
|
void |
setPostponeEvents(boolean postponeEvents)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EventQueue
public EventQueue()
postEvent
public void postEvent(java.lang.Class listenerInterface,
java.util.EventListener target,
java.util.EventObject event,
java.lang.String method)
- Currently does not queue up events to be sent later on. Rather they are sent immediately.
TODO: queue up events.
Note that further events can of course be sent while sending events.
setPostponeEvents
public void setPostponeEvents(boolean postponeEvents)
processEvents
public void processEvents(Application application)
throws java.lang.Exception
- Sends the events and clears the event queue.
java.lang.Exception
iterateEvents
public java.util.Iterator iterateEvents()
- Returns a thread safe iterator over the current events. Events can be added while
using this iterator but they will not be added to this iterator. To process the events
posted while processing these events another iterator must be added.
reset
public void reset()
Copyright © 2002-2002 . All Rights Reserved.