While looking through the current CVS source, I have a question concerning on 
propagation of events in GraphElement:


  | // event handling 
///////////////////////////////////////////////////////////
  | 
  |   public void fireEvent(String eventType, ExecutionContext 
executionContext) {
  |     Token token = executionContext.getToken();
  | 
  |     log.debug( "event '"+eventType+"' on '"+this+"' for '"+token+"'" );
  | 
  |     try {
  |       executionContext.setEventSource(this);
  |       fireAndPropagateEvent(eventType, executionContext);
  |     } finally {
  |       executionContext.setEventSource(null);
  |     }
  |   }
  | 
  |   public void fireAndPropagateEvent(String eventType, ExecutionContext 
executionContext) {
  |     // calculate if the event was fired on this element or if it was a 
propagated event
  |     boolean isPropagated = (this.equals(executionContext.getEventSource()));
  | 
  |     // execute static actions 
  |     // .....
  | }
  | 
  |  void executeActions(List actions, ExecutionContext executionContext, 
boolean isPropagated) {
  |     if (actions!=null) {
  |       Iterator iter = actions.iterator();
  |       while (iter.hasNext()) {
  |         Action action = (Action) iter.next();
  |         if ( action.acceptsPropagatedEvents()
  |              || (!isPropagated)
  |            ) {
  |          .....
  |         }
  |       }
  |     }
  | 

IMO, the boolean condition 


  | boolean isPropagated = (this.equals(executionContext.getEventSource()));
  | 

should be inverted, since when the executionContext's event source is the 
same as the surrounding graph element, then the event is not 
propagating but originating from this GraphElement. (see the lines above).

Please correct me, when I'm wrong.

...roland

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4017841#4017841

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4017841
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to