// Invoke the super-class implementation first. If no super-class,
// this will do nothing and return false.
invocation.proceed();
ComponentEvent event = (ComponentEvent) invocation.getParameter(0);
if (invokeEventHandlers(event, invocation.getInstance()))
invocation.setReturnValue(true);
}
private boolean invokeEventHandlers(ComponentEvent event, Object instance)
{
// If the super-class aborted the event (some super-class method return non-null),
// then it's all over, don't even check for handlers in this class.
if (event.isAborted())
return false;
boolean didInvokeSomeHandler = false;
for (EventHandlerMethodInvoker invoker : invokersArray)
{
if (event.matches(invoker.getEventType(), invoker.getComponentId(),
invoker.getMinContextValueCount()))
{
didInvokeSomeHandler = true;
invoker.invokeEventHandlerMethod(event, instance);
if (event.isAborted())
break;
}
}
return didInvokeSomeHandler;