You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2011/06/20 17:55:46 UTC
svn commit: r1137672 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Author: lu4242
Date: Mon Jun 20 15:55:46 2011
New Revision: 1137672
URL: http://svn.apache.org/viewvc?rev=1137672&view=rev
Log:
MYFACES-3179 Inconsistent behaviour implementing and registering SystemEventListeners for PostAddToViewEvents
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=1137672&r1=1137671&r2=1137672&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java Mon Jun 20 15:55:46 2011
@@ -545,10 +545,23 @@ public class FacesConfigurator
// 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()));
+ //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()));
+
+ if (systemEventListener.getSourceClass() != null && systemEventListener.getSourceClass().length() > 0)
+ {
+ application.subscribeToEvent(
+ (Class<? extends SystemEvent>)eventClass , ClassUtils.classForName(systemEventListener.getSourceClass()),
+ (javax.faces.event.SystemEventListener)ClassUtils.newInstance(systemEventListener.getSystemEventListenerClass()));
+ }
+ else
+ {
+ application.subscribeToEvent(
+ (Class<? extends SystemEvent>)eventClass ,
+ (javax.faces.event.SystemEventListener)ClassUtils.newInstance(systemEventListener.getSystemEventListenerClass()));
+ }
} catch (ClassNotFoundException e) {
log.log(Level.SEVERE, "System event listener could not be initialized, reason:",e);
}