deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject deltaspike git commit: DELTASPIKE-790 cache result for JsfModuleConfig#isDelegatedWindowHandlingEnabled
Date Fri, 28 Nov 2014 21:41:26 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master e0c2ab65b -> 7a1941913


DELTASPIKE-790 cache result for JsfModuleConfig#isDelegatedWindowHandlingEnabled


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

Branch: refs/heads/master
Commit: 7a1941913ee52d4285bea075ed19c466cddd404e
Parents: e0c2ab6
Author: gpetracek <gpetracek@apache.org>
Authored: Fri Nov 28 22:21:58 2014 +0100
Committer: gpetracek <gpetracek@apache.org>
Committed: Fri Nov 28 22:26:24 2014 +0100

----------------------------------------------------------------------
 .../jsf/api/config/JsfModuleConfig.java          | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/7a194191/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
index e777227..f754d44 100644
--- a/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
+++ b/deltaspike/modules/jsf/api/src/main/java/org/apache/deltaspike/jsf/api/config/JsfModuleConfig.java
@@ -38,6 +38,8 @@ public class JsfModuleConfig implements DeltaSpikeConfig
 
     private static final long serialVersionUID = -487295181899986237L;
 
+    protected Boolean delegatedWindowHandlingEnabled;
+
     protected JsfModuleConfig()
     {
     }
@@ -109,13 +111,28 @@ public class JsfModuleConfig implements DeltaSpikeConfig
      */
     public ClientWindowConfig.ClientWindowRenderMode getDefaultWindowMode()
     {
-        if (isDelegatedWindowHandlingEnabled())
+        if (this.delegatedWindowHandlingEnabled == null)
+        {
+            lazyInitDelegatedWindowHandlingEnabled();
+        }
+
+        if (this.delegatedWindowHandlingEnabled)
         {
             return ClientWindowConfig.ClientWindowRenderMode.DELEGATED;
         }
         return null;
     }
 
+    protected synchronized void lazyInitDelegatedWindowHandlingEnabled()
+    {
+        if (this.delegatedWindowHandlingEnabled != null)
+        {
+            return;
+        }
+
+        this.delegatedWindowHandlingEnabled = isDelegatedWindowHandlingEnabled();
+    }
+
     /**
      * Defines the {@link javax.enterprise.Qualifier} which will be used to fire the
      * {@link org.apache.deltaspike.core.api.exception.control.event.ExceptionToCatchEvent}


Mime
View raw message