You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by gp...@apache.org on 2010/08/08 08:23:46 UTC

svn commit: r983354 - in /myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl: scope/conversation/DefaultWindowContextManager.java util/DevUtils.java

Author: gpetracek
Date: Sun Aug  8 06:23:46 2010
New Revision: 983354

URL: http://svn.apache.org/viewvc?rev=983354&view=rev
Log:
cleanup

Added:
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/util/DevUtils.java
Modified:
    myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/scope/conversation/DefaultWindowContextManager.java

Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/scope/conversation/DefaultWindowContextManager.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/scope/conversation/DefaultWindowContextManager.java?rev=983354&r1=983353&r2=983354&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/scope/conversation/DefaultWindowContextManager.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/scope/conversation/DefaultWindowContextManager.java Sun Aug  8 06:23:46 2010
@@ -30,7 +30,6 @@ import static org.apache.myfaces.extensi
 import org.apache.myfaces.extensions.cdi.javaee.jsf.api.listener.phase.AfterPhase;
 import org.apache.myfaces.extensions.cdi.javaee.jsf.api.listener.phase.PhaseId;
 import org.apache.myfaces.extensions.cdi.javaee.jsf.api.request.RequestTypeResolver;
-import org.apache.myfaces.extensions.cdi.javaee.jsf.api.request.BeforeFacesRequest;
 import org.apache.myfaces.extensions.cdi.javaee.jsf.impl.scope.conversation.spi.WindowHandler;
 import org.apache.myfaces.extensions.cdi.javaee.jsf.impl.util.ConversationUtils;
 import org.apache.myfaces.extensions.cdi.javaee.jsf.impl.util.JsfUtils;
@@ -65,8 +64,6 @@ import java.util.concurrent.ConcurrentHa
 import java.lang.annotation.Annotation;
 
 /**
- * TODO don't cleanup in case of partial requests (via RequestTypeResolver)
- *
  * @author Gerhard Petracek
  */
 @SuppressWarnings({"UnusedDeclaration"})
@@ -152,13 +149,6 @@ public class DefaultWindowContextManager
         RequestCache.resetCache();
     }
 
-    protected void resetCacheInDevMode(@Observes @BeforeFacesRequest FacesContext facesContext)
-    {
-        //TODO activate it only in project-stage dev.
-        //org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener causes re-eval (+ caching) of window-id
-        JsfUtils.resetCaches();
-    }
-
     @Produces
     @Named(WindowContext.CURRENT_WINDOW_CONTEXT_BEAN_NAME)
     @RequestScoped
@@ -202,7 +192,6 @@ public class DefaultWindowContextManager
         };
     }
 
-    //TODO improve performance
     public WindowContext getCurrentWindowContext()
     {
         String windowContextId = RequestCache.getCurrentWindowId();
@@ -291,13 +280,11 @@ public class DefaultWindowContextManager
         return cacheWindowId(facesContext.getExternalContext(), windowContext.getId());
     }
 
-    //TODO
     public void resetCurrentWindowContext()
     {
         resetWindowContext(getCurrentWindowContext());
     }
 
-    //TODO
     public void resetWindowContext(String windowContextId)
     {
         resetWindowContext(getWindowContext(windowContextId));
@@ -327,7 +314,6 @@ public class DefaultWindowContextManager
         JsfUtils.resetCaches();
         for (Conversation conversation : ((EditableWindowContext)windowContext).getConversations().values())
         {
-            //TODO
             ((EditableConversation)conversation).deactivate();
              //it isn't possible to deactivate window scoped conversations
             if (!((EditableConversation)conversation).isActive())
@@ -370,7 +356,6 @@ public class DefaultWindowContextManager
 
         for (Conversation conversation : ((EditableWindowContext)windowContext).getConversations().values())
         {
-            //TODO test the usage of #isActiveState instead of isActive
             if (!((EditableConversation)conversation).isActive())
             {
                 conversation.end();

Added: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/util/DevUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/util/DevUtils.java?rev=983354&view=auto
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/util/DevUtils.java (added)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/javaee/jsf/impl/util/DevUtils.java Sun Aug  8 06:23:46 2010
@@ -0,0 +1,37 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.cdi.javaee.jsf.impl.util;
+
+import org.apache.myfaces.extensions.cdi.javaee.jsf.api.request.BeforeFacesRequest;
+
+import javax.enterprise.event.Observes;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Gerhard Petracek
+ */
+public class DevUtils
+{
+    protected void resetCacheInDevMode(@Observes @BeforeFacesRequest FacesContext facesContext)
+    {
+        //TODO activate it only in project-stage dev.
+        //org.apache.myfaces.view.facelets.tag.ui.DebugPhaseListener causes re-eval (+ caching) of window-id
+        JsfUtils.resetCaches();
+    }
+}