[jboss-cvs] JBossAS SVN: r114819 - branches/JBPAPP_5_2_0_GA_JBPAPP-11185/server/src/main/org/jboss/web/deployers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Sep 22 15:15:45 EDT 2014


Author: bmaxwell
Date: 2014-09-22 15:15:44 -0400 (Mon, 22 Sep 2014)
New Revision: 114819

Modified:
   branches/JBPAPP_5_2_0_GA_JBPAPP-11185/server/src/main/org/jboss/web/deployers/WARStructure.java
Log:
[JBPAPP-11185][JBPAPP-10675] Add -Djboss.war.forceCopy=true option to force VFS to copy WAR contents to temporary location on deployment even if the WAR is deployed exploded.  Prevents classloading error when a component tries to load a class as the application is shutting down after hot undeploy

Modified: branches/JBPAPP_5_2_0_GA_JBPAPP-11185/server/src/main/org/jboss/web/deployers/WARStructure.java
===================================================================
--- branches/JBPAPP_5_2_0_GA_JBPAPP-11185/server/src/main/org/jboss/web/deployers/WARStructure.java	2014-09-22 19:13:28 UTC (rev 114818)
+++ branches/JBPAPP_5_2_0_GA_JBPAPP-11185/server/src/main/org/jboss/web/deployers/WARStructure.java	2014-09-22 19:15:44 UTC (rev 114819)
@@ -22,11 +22,14 @@
 package org.jboss.web.deployers;
 
 import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.ModificationType;
 import org.jboss.deployers.vfs.plugins.structure.AbstractVFSStructureDeployer;
 import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.virtual.VirtualFile;
@@ -55,6 +58,14 @@
    /** Whether to include web-inf in the classpath */
    private boolean includeWebInfInClasspath;
 
+   private static final boolean forceCopy = AccessController.doPrivileged(new PrivilegedAction<Boolean>(){
+       @Override
+       public Boolean run() {
+           String result = System.getProperty("jboss.war.forceCopy");
+           return Boolean.valueOf(result);
+       }   
+   }).booleanValue();
+
    /**
     * Sets the default relative order 1000.
     *
@@ -117,6 +128,16 @@
       this.includeWebInfInClasspath = includeWebInfInClasspath;
    }
 
+   @Override
+   protected void applyContextInfo(StructureContext context, ContextInfo result)
+   {
+       super.applyContextInfo(context, result);
+       if(forceCopy)
+       {
+           result.setModificationType(ModificationType.TEMP);
+       }
+   }
+
    public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       ContextInfo context = null;



More information about the jboss-cvs-commits mailing list