myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1137670 - /myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Date Mon, 20 Jun 2011 15:52:12 GMT
Author: lu4242
Date: Mon Jun 20 15:52:11 2011
New Revision: 1137670

URL: http://svn.apache.org/viewvc?rev=1137670&view=rev
Log:
MYFACES-3179 Inconsistent behaviour implementing and registering SystemEventListeners for
PostAddToViewEvents

Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java?rev=1137670&r1=1137669&r2=1137670&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
(original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/config/FacesConfigurator.java
Mon Jun 20 15:52:11 2011
@@ -538,10 +538,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);
             }



Mime
View raw message