deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tandrasc...@apache.org
Subject git commit: DELTASPIKE-621 DeltaSpikeResourceHandler should implement Deactivatable
Date Tue, 10 Jun 2014 21:22:04 GMT
Repository: deltaspike
Updated Branches:
  refs/heads/master 16f247c73 -> b7a142d39


DELTASPIKE-621 DeltaSpikeResourceHandler should implement Deactivatable

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

Branch: refs/heads/master
Commit: b7a142d396872a08fcff0f4cfed5bf2e58f35ee6
Parents: 16f247c
Author: tandraschko <tandraschko@apache.org>
Authored: Tue Jun 10 23:21:48 2014 +0200
Committer: tandraschko <tandraschko@apache.org>
Committed: Tue Jun 10 23:21:48 2014 +0200

----------------------------------------------------------------------
 .../jsf/impl/resource/DeltaSpikeResourceHandler.java         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/b7a142d3/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
----------------------------------------------------------------------
diff --git a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
index dbb58c4..dba228b 100644
--- a/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
+++ b/deltaspike/modules/jsf/impl/src/main/java/org/apache/deltaspike/jsf/impl/resource/DeltaSpikeResourceHandler.java
@@ -22,19 +22,22 @@ import javax.faces.application.Resource;
 import javax.faces.application.ResourceHandler;
 import javax.faces.application.ResourceHandlerWrapper;
 import org.apache.deltaspike.core.api.projectstage.ProjectStage;
+import org.apache.deltaspike.core.spi.activation.Deactivatable;
+import org.apache.deltaspike.core.util.ClassDeactivationUtils;
 import org.apache.deltaspike.core.util.ClassUtils;
 import org.apache.deltaspike.core.util.ProjectStageProducer;
 
 /**
  * {@link ResourceHandlerWrapper} to deliver uncompressed resources in {@link ProjectStage#Development}.
  */
-public class DeltaSpikeResourceHandler extends ResourceHandlerWrapper
+public class DeltaSpikeResourceHandler extends ResourceHandlerWrapper implements Deactivatable
 {
     private static final String LIBRARY = "deltaspike";
     private static final String LIBRARY_UNCOMPRESSED = "deltaspike-uncompressed";
     
     private final ResourceHandler wrapped;
     private final String version;
+    private final boolean activated;
 
     public DeltaSpikeResourceHandler(ResourceHandler resourceHandler)
     {
@@ -42,6 +45,7 @@ public class DeltaSpikeResourceHandler extends ResourceHandlerWrapper
 
         wrapped = resourceHandler;
         version = ClassUtils.getJarVersion(this.getClass());
+        activated = ClassDeactivationUtils.isActivated(this.getClass());
     }
 
     @Override
@@ -49,7 +53,7 @@ public class DeltaSpikeResourceHandler extends ResourceHandlerWrapper
     {
         Resource resource = wrapped.createResource(resourceName, libraryName);
 
-        if (resource != null && libraryName != null && LIBRARY.equals(libraryName))
+        if (activated && resource != null && libraryName != null &&
LIBRARY.equals(libraryName))
         {
             if (ProjectStageProducer.getInstance().getProjectStage() == ProjectStage.Development)
             {


Mime
View raw message