Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2
  • Fix Version/s: 1.3-rc1
  • Component/s: None
  • Labels:
    None
  • Similar Issues:
    None

Description

I am using the mule version 1.2 downloaded from the http://mule.codehaus.org/

I may have found a bug in the ServerEventManager when using CustomEventListener and CustomEvent. My scenario is as follows

I have created a custom event listener and extended the CustomEvent object to create my own specific type of custom event.

After registering my event listener with the MuleManager and try to run some code to fire my specific type custom event, I found that the event does not trigger the invocation of my event listener. However, if I fire the original "base-class" CustomEvent object, it can trigger the invocation of my event listener.

This makes me to investigate what is going wrong inside Mule and I found the following piece of code in the org.mule.impl.internal.events.ServerEventManager.notifyListeners(UMOServerEvent event) method,

Map.Entry entry = null;
for (Iterator iterator = eventsMap.entrySet().iterator(); iterator.hasNext() {
entry = (Map.Entry) iterator.next();
Class eventClass = (Class) entry.getValue();
if (event.getClass().isAssignableFrom(eventClass)) { listenerClass = (Class) entry.getKey(); break; }
}

It seems that inside the condition inside the if statement should be changed to

if (eventClass.isAssignableFrom(event.getClass()) {
........
}

i.e. the eventClass and the event.getClass() should be interchanged with each other.

Activity

Hide
Ross Mason added a comment -

This has been fixed

Show
Ross Mason added a comment - This has been fixed

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: