use of com.sun.faces.application.applicationimpl.events.EventInfo in project mojarra by eclipse-ee4j.
the class Events method getListeners.
/**
* @return the SystemEventListeners that should be used for the provided combination of SystemEvent and source.
*/
private Set<SystemEventListener> getListeners(Class<? extends SystemEvent> systemEvent, Class<?> sourceClass) {
Set<SystemEventListener> listeners = null;
EventInfo sourceInfo = systemEventHelper.getEventInfo(systemEvent, sourceClass);
if (sourceInfo != null) {
listeners = sourceInfo.getListeners();
}
return listeners;
}
use of com.sun.faces.application.applicationimpl.events.EventInfo in project mojarra by eclipse-ee4j.
the class Events method invokeComponentListenersFor.
/**
* @return process any listeners for the specified SystemEventListenerHolder and return any SystemEvent that may have
* been created as a side-effect of processing the listeners.
*/
private SystemEvent invokeComponentListenersFor(Class<? extends SystemEvent> systemEventClass, Object source) {
if (source instanceof SystemEventListenerHolder) {
List<SystemEventListener> listeners = ((SystemEventListenerHolder) source).getListenersForEventClass(systemEventClass);
if (null == listeners) {
return null;
}
EventInfo eventInfo = compSysEventHelper.getEventInfo(systemEventClass, source.getClass());
return processListeners(listeners, null, source, eventInfo);
}
return null;
}
use of com.sun.faces.application.applicationimpl.events.EventInfo in project mojarra by eclipse-ee4j.
the class Events method invokeListenersFor.
/**
* Traverse the <code>List</code> of listeners and invoke any that are relevent for the specified source.
*
* @throws jakarta.faces.event.AbortProcessingException propagated from the listener invocation
*/
private SystemEvent invokeListenersFor(Class<? extends SystemEvent> systemEventClass, SystemEvent event, Object source, Class<?> sourceBaseType, boolean useSourceLookup) throws AbortProcessingException {
EventInfo eventInfo = systemEventHelper.getEventInfo(systemEventClass, source, sourceBaseType, useSourceLookup);
if (eventInfo != null) {
Set<SystemEventListener> listeners = eventInfo.getListeners();
event = processListeners(listeners, event, source, eventInfo);
}
return event;
}
use of com.sun.faces.application.applicationimpl.events.EventInfo in project mojarra by eclipse-ee4j.
the class Events method invokeViewListenersFor.
private SystemEvent invokeViewListenersFor(FacesContext ctx, Class<? extends SystemEvent> systemEventClass, SystemEvent event, Object source) {
SystemEvent result = event;
if (listenerInvocationGuard.isGuardSet(ctx, systemEventClass)) {
return result;
}
listenerInvocationGuard.setGuard(ctx, systemEventClass);
UIViewRoot root = ctx.getViewRoot();
try {
if (root != null) {
List<SystemEventListener> listeners = root.getViewListenersForEventClass(systemEventClass);
if (null == listeners) {
return null;
}
EventInfo rootEventInfo = systemEventHelper.getEventInfo(systemEventClass, UIViewRoot.class);
// process view listeners
result = processListenersAccountingForAdds(listeners, event, source, rootEventInfo);
}
} finally {
listenerInvocationGuard.clearGuard(ctx, systemEventClass);
}
return result;
}
Aggregations