deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject git commit: DELTASPIKE-563 deactivatable phase-listeners
Date Tue, 08 Apr 2014 10:14:37 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master e61dda0f0 -> ccac36f2f


DELTASPIKE-563 deactivatable phase-listeners


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

Branch: refs/heads/master
Commit: ccac36f2f6ace20f499cd82cb7382ce6ff7cc3cc
Parents: e61dda0
Author: gpetracek <gpetracek@apache.org>
Authored: Tue Apr 8 12:12:03 2014 +0200
Committer: gpetracek <gpetracek@apache.org>
Committed: Tue Apr 8 12:12:03 2014 +0200

----------------------------------------------------------------------
 .../listener/phase/JsfRequestLifecycleBroadcaster.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/ccac36f2/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
index dfef069..7dd86af 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/listener/phase/JsfRequestLifecycleBroadcaster.java
@@ -18,6 +18,9 @@
  */
 package org.apache.deltaspike.jsf.impl.listener.phase;
 
+import org.apache.deltaspike.core.spi.activation.Deactivatable;
+import org.apache.deltaspike.core.util.ClassDeactivationUtils;
+import org.apache.deltaspike.core.util.ProxyUtils;
 import org.apache.deltaspike.jsf.api.listener.phase.AfterPhase;
 import org.apache.deltaspike.jsf.api.listener.phase.BeforePhase;
 import org.apache.deltaspike.jsf.api.listener.phase.JsfPhaseId;
@@ -63,10 +66,18 @@ public class JsfRequestLifecycleBroadcaster
     @Inject
     protected JsfRequestLifecycleBroadcaster(Instance<PhaseListener> phaseListenerInstance)
     {
+        Class phaseListenerClass;
         for (PhaseListener currentPhaseListener : phaseListenerInstance)
         {
-            if (currentPhaseListener.getClass().isAnnotationPresent(JsfPhaseListener.class))
+            phaseListenerClass = ProxyUtils.getUnproxiedClass(currentPhaseListener.getClass());
+
+            if (phaseListenerClass.isAnnotationPresent(JsfPhaseListener.class))
             {
+                if (Deactivatable.class.isAssignableFrom(phaseListenerClass) &&
+                    !ClassDeactivationUtils.isActivated(phaseListenerClass))
+                {
+                    continue;
+                }
                 this.phaseListeners.add(currentPhaseListener);
             }
         }


Mime
View raw message