deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject git commit: DELTASPIKE-529 fixed initialization in non-EE environment
Date Wed, 26 Feb 2014 18:02:30 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master c4353b11e -> 10478c8e8


DELTASPIKE-529 fixed initialization in non-EE environment

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

Branch: refs/heads/master
Commit: 10478c8e8ffff4cec8b27dd37e3ebe2dd37ed4f9
Parents: c4353b1
Author: tandraschko <tandraschko@apache.org>
Authored: Wed Feb 26 19:02:19 2014 +0100
Committer: tandraschko <tandraschko@apache.org>
Committed: Wed Feb 26 19:02:19 2014 +0100

----------------------------------------------------------------------
 .../exception/DeltaSpikeExceptionHandler.java    | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/10478c8e/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
index f1b03f3..3dbb878 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/exception/DeltaSpikeExceptionHandler.java
@@ -37,16 +37,16 @@ import org.apache.deltaspike.jsf.api.config.JsfModuleConfig;
 public class DeltaSpikeExceptionHandler extends ExceptionHandlerWrapper implements Deactivatable
 {
     private final ExceptionHandler wrapped;
-    private final Annotation exceptionQualifier;
 
+    private volatile Boolean initialized;
+    
+    private Annotation exceptionQualifier;
     private boolean isActivated = true;
 
     public DeltaSpikeExceptionHandler(ExceptionHandler wrapped)
     {
         this.isActivated = ClassDeactivationUtils.isActivated(getClass());
         this.wrapped = wrapped;
-        this.exceptionQualifier = AnnotationInstanceProvider.of(
-                BeanProvider.getContextualReference(JsfModuleConfig.class).getExceptionQualifier());
     }
 
     @Override
@@ -60,6 +60,8 @@ public class DeltaSpikeExceptionHandler extends ExceptionHandlerWrapper
implemen
     {
         if (isActivated)
         {
+            init();
+            
             FacesContext context = FacesContext.getCurrentInstance();
 
             if (context.getResponseComplete())
@@ -99,4 +101,15 @@ public class DeltaSpikeExceptionHandler extends ExceptionHandlerWrapper
implemen
 
         super.handle();
     }
+    
+    private synchronized void init()
+    {
+        if (this.initialized == null)
+        {
+            this.exceptionQualifier = AnnotationInstanceProvider.of(
+                    BeanProvider.getContextualReference(JsfModuleConfig.class).getExceptionQualifier());
+
+            this.initialized = true;
+        }
+    }
 }


Mime
View raw message