deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject git commit: DELTASPIKE-509 [perf] cache map in DefaultClientWindow#getQueryURLParameters
Date Thu, 31 Jul 2014 21:24:40 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 2be8af863 -> cf109c757


DELTASPIKE-509 [perf] cache map in DefaultClientWindow#getQueryURLParameters

Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/cf109c75
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/cf109c75
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/cf109c75

Branch: refs/heads/master
Commit: cf109c757df757fd9476cfa835275200ca7b1031
Parents: 2be8af8
Author: tandraschko <tandraschko@apache.org>
Authored: Thu Jul 31 23:24:31 2014 +0200
Committer: tandraschko <tandraschko@apache.org>
Committed: Thu Jul 31 23:24:31 2014 +0200

----------------------------------------------------------------------
 .../impl/scope/window/DefaultClientWindow.java  | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/cf109c75/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
index ff1c67a..0389425 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/scope/window/DefaultClientWindow.java
@@ -93,6 +93,9 @@ public class DefaultClientWindow implements ClientWindow
     private static final String WINDOW_ID_REQUEST_MAP_KEY =
             ClientWindow.class.getName() + ".WindowId";
 
+    private static final String CACHE_QUERY_URL_PARAMETERS =
+            "CACHE:" + DefaultClientWindow.class + "#getQueryURLParameters";
+    
     @Inject
     private ClientWindowConfig clientWindowConfig;
 
@@ -373,13 +376,22 @@ public class DefaultClientWindow implements ClientWindow
 
         if (ClientWindowRenderMode.LAZY.equals(clientWindowRenderMode))
         {
-            String windowId = getWindowId(facesContext);
-            if (windowId != null)
+            if (!facesContext.getAttributes().containsKey(CACHE_QUERY_URL_PARAMETERS))
             {
+                String windowId = getWindowId(facesContext);
+                
+                if (windowId == null)
+                {
+                    return null;
+                }
+                
                 Map<String, String> params = new HashMap<String, String>();
-                params.put(DELTASPIKE_WINDOW_ID_URL_PARAM, getWindowId(facesContext));
-                return params;
+                params.put(DELTASPIKE_WINDOW_ID_URL_PARAM, windowId);
+
+                facesContext.getAttributes().put(CACHE_QUERY_URL_PARAMETERS, params);
             }
+
+            return (Map<String, String>) facesContext.getAttributes().get(CACHE_QUERY_URL_PARAMETERS);
         }
 
         return null;


Mime
View raw message