myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject svn commit: r918202 - in /myfaces/extensions/scripting/trunk: core/core/src/main/java/org/apache/myfaces/scripting/api/ core/core/src/main/java/org/apache/myfaces/scripting/refresh/ examples/myfaces20-example/src/main/webapp/WEB-INF/ examples/myfaces20...
Date Tue, 02 Mar 2010 21:37:40 GMT
Author: werpu
Date: Tue Mar  2 21:37:40 2010
New Revision: 918202

URL: http://svn.apache.org/viewvc?rev=918202&view=rev
Log:
https://issues.apache.org/jira/browse/EXTSCRIPT-81

adding the taint history to our handler
that way we now can cover multi user bean refresh properly

Modified:
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/MyFacesBeanHandler.java
    myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/refresh/FileChangedDaemon.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java
    myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/MyFacesBeanHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/MyFacesBeanHandler.java?rev=918202&r1=918201&r2=918202&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/MyFacesBeanHandler.java
(original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/api/MyFacesBeanHandler.java
Tue Mar  2 21:37:40 2010
@@ -19,13 +19,13 @@
  * Bean handler implementation
  * which encapsulates the myfaces specific parts
  * of the bean processing
- *
- *
+ * <p/>
+ * <p/>
  * TODO bug multiuser handling not yet working
  * due to tainted being reset for beans once the
  * first user has run through the refresh,
  * others do not drop their code...
- *
+ * <p/>
  * we need a bean taint history so that
  * users refreshing get a blend of all tainted classes
  * since their last local refresh
@@ -281,6 +281,12 @@
     private void refreshPersonalScopedBeans() {
         //the refreshing is only allowed if no compile is in progress
         //and vice versa
+        Map sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
+        Long taintingPeriod = (Long) sessionMap.get(ScriptingConst.SESS_BEAN_REFRESH_TIMER);
+        if (taintingPeriod == null) {
+            taintingPeriod = -1l;
+        }
+        Set<String> taintedInTime = WeavingContext.getRefreshContext().getTaintHistoryClasses(taintingPeriod);
 
         synchronized (RefreshContext.BEAN_SYNC_MONITOR) {
             Map<String, ManagedBean> mbeans = RuntimeConfig.getCurrentInstance(FacesContext.getCurrentInstance().getExternalContext()).getManagedBeans();
@@ -290,11 +296,10 @@
             //the bean map from outside we still get race conditions
             //But for most cases this mutex should be enough
             Map<String, ManagedBean> mbeansSnapshotView = makeSnapshot(mbeans);
-            Set<String> tainted = getTaintedClasses();
-            for (Map.Entry<String, ManagedBean> entry : mbeansSnapshotView.entrySet())
{
 
+            for (Map.Entry<String, ManagedBean> entry : mbeansSnapshotView.entrySet())
{
                 Class managedBeanClass = entry.getValue().getManagedBeanClass();
-                if (hasToBeRefreshed(tainted, managedBeanClass)) {
+                if (hasToBeRefreshed(taintedInTime, managedBeanClass)) {
                     FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove(entry.getValue().getManagedBeanName());
                     removeCustomScopedBean(entry.getValue());
                 }

Modified: myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/refresh/FileChangedDaemon.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/refresh/FileChangedDaemon.java?rev=918202&r1=918201&r2=918202&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/refresh/FileChangedDaemon.java
(original)
+++ myfaces/extensions/scripting/trunk/core/core/src/main/java/org/apache/myfaces/scripting/refresh/FileChangedDaemon.java
Tue Mar  2 21:37:40 2010
@@ -168,7 +168,7 @@
             metaData.setTainted(true);
             metaData.setTaintedOnce(true);
             dependencyTainted(metaData.getAClass().getName());
-
+            WeavingContext.getRefreshContext().addTaintLogEntry(metaData);
         }
     }
 

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java?rev=918202&r1=918201&r2=918202&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java
(original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean2.java
Tue Mar  2 21:37:40 2010
@@ -52,7 +52,7 @@
     public String getSayHello() {
         System.out.println("cnt++:" + cnt++);
         
-        return   bean3.getSayHello();
+        return   bean4.getHello();
     }
 
     

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java?rev=918202&r1=918201&r2=918202&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java
(original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/java/org/apache/myfaces/javaloader/test/TestBean4.java
Tue Mar  2 21:37:40 2010
@@ -33,5 +33,6 @@
 
     public void setHello(String hello) {
         this.hello = hello;
-    }
+    } 
 }
+ 
\ No newline at end of file

Modified: myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml?rev=918202&r1=918201&r2=918202&view=diff
==============================================================================
--- myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
(original)
+++ myfaces/extensions/scripting/trunk/examples/myfaces20-example/src/main/webapp/WEB-INF/web.xml
Tue Mar  2 21:37:40 2010
@@ -31,7 +31,6 @@
         <param-value>org.apache.myfaces.scripting.servlet.StartupServletContextPluginChainLoader</param-value>
     </context-param>
 
-    <!--
     <context-param>
         <description>Additional comma separated loader paths to allow direct editing
on the sources directory instead
             of the deployment dir
@@ -68,7 +67,7 @@
         <param-name>facelets.RESOURCE_RESOLVER</param-name>
         <param-value>org.apache.myfaces.scripting.facelet.ReroutingResourceResolver</param-value>
     </context-param>
-    -->
+
     <!--
     <context-param>
         <description>a comma separated whitelist of root packages which are compiled
those and nothing else



Mime
View raw message