try {
//note here used to be an instantiation to deal with the explicit source type in the registration,
// that cannot work because all system events need to have the source being passed in the constructor
//instead we now rely on the standard system event types and map them to their appropriate constructor types
Class eventClass = ClassUtils.classForName((systemEventListener.getSystemEventClass() != null) ? systemEventListener.getSystemEventClass():SystemEvent.class.getName());
application.subscribeToEvent(
(Class<? extends SystemEvent>)eventClass ,
(Class<?>)ClassUtils.classForName((systemEventListener.getSourceClass() != null) ? systemEventListener.getSourceClass(): getDefaultSourcClassForSystemEvent(eventClass) ), //Application.class???
(javax.faces.event.SystemEventListener)ClassUtils.newInstance(systemEventListener.getSystemEventListenerClass()));
} catch (ClassNotFoundException e) {
log.log(Level.SEVERE, "System event listener could not be initialized, reason:",e);