myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r1055394 - in /myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl: listener/phase/JsfRequestLifecycleBroadcaster.java scope/conversation/WindowContextManagerObserver.java
Date Wed, 05 Jan 2011 10:25:17 GMT
Author: gpetracek
Date: Wed Jan  5 10:25:17 2011
New Revision: 1055394

URL: http://svn.apache.org/viewvc?rev=1055394&view=rev
Log:
EXTCDI-49 resetting the request-cache

Modified:
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/WindowContextManagerObserver.java

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java?rev=1055394&r1=1055393&r2=1055394&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
(original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
Wed Jan  5 10:25:17 2011
@@ -22,10 +22,12 @@ import org.apache.myfaces.extensions.cdi
 import org.apache.myfaces.extensions.cdi.jsf.api.listener.phase.JsfLifecyclePhaseInformation;
 import org.apache.myfaces.extensions.cdi.jsf.api.listener.phase.AfterPhase;
 import org.apache.myfaces.extensions.cdi.jsf.api.listener.phase.BeforePhase;
+import org.apache.myfaces.extensions.cdi.jsf.impl.util.RequestCache;
 
 import javax.enterprise.context.RequestScoped;
 import javax.enterprise.event.Event;
 import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
 import javax.inject.Inject;
 import javax.inject.Named;
 import java.lang.annotation.Annotation;
@@ -65,6 +67,14 @@ public class JsfRequestLifecycleBroadcas
     {
         this.phaseEvent.select(createAnnotationLiteral(phaseEvent.getPhaseId(), false)).fire(phaseEvent);
         this.afterAnyPhaseEvent.fire(phaseEvent);
+
+        if(PhaseId.RENDER_RESPONSE.equals(phaseEvent.getPhaseId()))
+        {
+            //if the cache would get resetted by an observer
+            //it might be the case that a 2nd observer accesses the cache again and afterwards
there won't be a cleanup
+            //-> don't remove:
+            RequestCache.resetCache();
+        }
     }
 
     private Annotation createAnnotationLiteral(javax.faces.event.PhaseId phaseId, boolean
isBeforeEvent)

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/WindowContextManagerObserver.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/WindowContextManagerObserver.java?rev=1055394&r1=1055393&r2=1055394&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/WindowContextManagerObserver.java
(original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/WindowContextManagerObserver.java
Wed Jan  5 10:25:17 2011
@@ -29,7 +29,6 @@ import org.apache.myfaces.extensions.cdi
 import org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi.EditableWindowContextManager;
 import org.apache.myfaces.extensions.cdi.jsf.impl.scope.conversation.spi.WindowHandler;
 import org.apache.myfaces.extensions.cdi.jsf.impl.util.ConversationUtils;
-import org.apache.myfaces.extensions.cdi.jsf.impl.util.RequestCache;
 import org.apache.myfaces.extensions.cdi.message.api.Message;
 
 import javax.enterprise.event.Observes;
@@ -126,8 +125,6 @@ final class WindowContextManagerObserver
         {
             cleanupInactiveWindowContexts(windowContextManager);
         }
-        
-        RequestCache.resetCache();
     }
 
     /**



Mime
View raw message