[jboss-cvs] JBossAS SVN: r57741 - in branches/JBoss_4_0_4_GA_CP/tomcat: . src/main/org/jboss/web/tomcat/security/config src/main/org/jboss/web/tomcat/tc5 src/resources

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 19 16:53:59 EDT 2006


Author: fnasser at redhat.com
Date: 2006-10-19 16:53:57 -0400 (Thu, 19 Oct 2006)
New Revision: 57741

Modified:
   branches/JBoss_4_0_4_GA_CP/tomcat/build.xml
   branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java
   branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java
   branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service-all.xml
   branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service.xml
   branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/server.xml
   branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/webserver-xmbean.xml
Log:
ASPATCH-58: JBAS-3519: Patch-Work directory shouldn't be deleted on Context Destroy

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/build.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/build.xml	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/build.xml	2006-10-19 20:53:57 UTC (rev 57741)
@@ -164,7 +164,6 @@
       <src path="${source.java}"/>
       <src path="${source.tests}"/>
       <classpath refid="javac.tomcat55.classpath"/>
-      <exclude name="org/jboss/web/tomcat/security/config/JBossContextConfig.java"/>
     </javac>
     <copy todir="${build.classes}">
       <fileset dir="${source.java}">

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/security/config/JBossContextConfig.java	2006-10-19 20:53:57 UTC (rev 57741)
@@ -52,6 +52,8 @@
    
    private boolean isTrace = log.isTraceEnabled();
    
+   private boolean DELEGATE_TO_PARENT = false; 
+   
    /**
     * Create a new JBossContextConfig.
     */
@@ -63,13 +65,28 @@
          Map authMap = this.getAuthenticators();
          if(authMap.size() > 0)
             customAuthenticators = authMap; 
+         this.DELEGATE_TO_PARENT = getDeleteWorkDir();
       }catch(Exception e)
       {
          log.error("Failed to customize authenticators::",e); 
       } 
-   } 
-   
+   }   
+    
    /**
+    * Process a "destroy" event for this Context.
+    */
+   protected synchronized void destroy()
+   { 
+      if(log.isTraceEnabled())
+         log.trace("destroy called with DELEGATE_TO_PARENT="
+               + DELEGATE_TO_PARENT);
+      if(DELEGATE_TO_PARENT)
+        super.destroy();
+   }
+
+
+
+   /**
     * Map of Authenticators
     * @return
     * @throws Exception
@@ -112,4 +129,19 @@
                        "Authenticators"); 
       return props; 
    }
+   
+   /**
+    * Get the flag that sets whether the work directory corresponding
+    * to the context needs to be deleted (delegate to parent) or not
+    * @return
+    * @throws JMException
+    */
+   private boolean getDeleteWorkDir() throws JMException
+   {
+      Boolean flag = Boolean.FALSE;
+      MBeanServer server = MBeanServerLocator.locateJBoss();
+      flag = (Boolean)server.getAttribute(new ObjectName("jboss.web:service=WebServer"),
+                       "DeleteWorkDirOnContextDestroy"); 
+      return flag.booleanValue(); 
+   }
 }

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java	2006-10-19 20:53:57 UTC (rev 57741)
@@ -137,6 +137,11 @@
    private boolean useJBossWebLoader = true;
 
    /**
+    * JBAS-3358: Work directory shouldn't be deleted on Context Destroy
+    */
+   private boolean deleteWorkDirOnContextDestroy = false;
+
+   /**
     * The server xml configuration file name
     */
    private String serverConfigFile = "server.xml";
@@ -296,6 +301,17 @@
       this.useJK = useJK;
    }
 
+   public boolean getDeleteWorkDirOnContextDestroy()
+   {
+      return deleteWorkDirOnContextDestroy;
+   }
+
+   public void setDeleteWorkDirOnContextDestroy(boolean deleteFlag)
+   {
+      this.deleteWorkDirOnContextDestroy = deleteFlag;
+   }
+
+
    /**
     * The SessionIdAlphabet is the set of characters used to create a session Id
     */

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service-all.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service-all.xml	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service-all.xml	2006-10-19 20:53:57 UTC (rev 57741)
@@ -10,7 +10,6 @@
 		  will apply the same set of authenticators across all web applications. You can
 		  override the set of authenticators at the web application level by adding
 		  <authenticators> element to the respective jboss-web.xml --> 
-	  <!--
 		  <attribute name="Authenticators" serialDataType="jbxb">
 			<java:properties xmlns:java="urn:jboss:java-properties"
 				xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
@@ -37,8 +36,6 @@
 				</java:property> 
 			</java:properties> 
 	   </attribute> 
-	   -->
-	   
 
       <!-- The JAAS security domain to use in the absense of an explicit
       security-domain specification in the war WEB-INF/jboss-web.xml
@@ -67,6 +64,9 @@
 
       <attribute name="LenientEjbLink">true</attribute>
 
+      <!--Flag to delete the Work Dir on Context Destroy -->
+      <attribute name="DeleteWorkDirOnContextDestroy">false</attribute>
+
       <!--
           Class of the session manager (used if context is marked as 'distributable'. Currently allowed values:
           - org.jboss.web.tomcat.tc5.session.JBossCacheManager

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service.xml	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/jboss-service.xml	2006-10-19 20:53:57 UTC (rev 57741)
@@ -10,10 +10,9 @@
 		  will apply the same set of authenticators across all web applications. You can
 		  override the set of authenticators at the web application level by adding
 		  <authenticators> element to the respective jboss-web.xml --> 
-	  <!--
-		  <attribute name="Authenticators" serialDataType="jbxb">
-			<java:properties xmlns:java="urn:jboss:java-properties"
-				xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
+             <attribute name="Authenticators" serialDataType="jbxb">
+                 <java:properties xmlns:java="urn:jboss:java-properties"
+                      xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
 				xs:schemaLocation="urn:jboss:java-properties resource:java-properties_1_0.xsd">
 				<java:property>
 					<java:key>BASIC</java:key>
@@ -37,9 +36,7 @@
 				</java:property> 
 			</java:properties> 
 	   </attribute> 
-	   -->
 	   
-	   
       <!-- The JAAS security domain to use in the absense of an explicit
       security-domain specification in the war WEB-INF/jboss-web.xml
       -->
@@ -69,6 +66,9 @@
 
       <attribute name="LenientEjbLink">true</attribute>
 
+      <!--Flag to delete the Work Dir on Context Destroy -->
+      <attribute name="DeleteWorkDirOnContextDestroy">false</attribute>
+
       <!--
           Class of the session manager (used if context is marked as 'distributable'. Currently allowed values:
           - org.jboss.web.tomcat.tc5.session.JBossCacheManager

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/server.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/server.xml	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/server.xml	2006-10-19 20:53:57 UTC (rev 57741)
@@ -71,14 +71,8 @@
          -->
 
          <Host name="localhost"
-            autoDeploy="false" deployOnStartup="false" deployXML="false">
-		 
-		 <!-- UNCOMMENT TO ENABLE CUSTOMIZATION OF TOMCAT AUTHENTICATORS	 
-			<Host name="localhost"
             autoDeploy="false" deployOnStartup="false" deployXML="false"
-			configClass="org.jboss.web.tomcat.security.config.JBossContextConfig">
-                -->
-		  
+            configClass="org.jboss.web.tomcat.security.config.JBossContextConfig">
 
             <!-- Uncomment to enable request dumper. This Valve "logs interesting 
                  contents from the specified Request (before processing) and the 

Modified: branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/webserver-xmbean.xml
===================================================================
--- branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/webserver-xmbean.xml	2006-10-19 19:31:55 UTC (rev 57740)
+++ branches/JBoss_4_0_4_GA_CP/tomcat/src/resources/webserver-xmbean.xml	2006-10-19 20:53:57 UTC (rev 57741)
@@ -34,6 +34,12 @@
      <type>boolean</type>
    </attribute>
 
+   <attribute access="read-write" getMethod="getDeleteWorkDirOnContextDestroy"
+    setMethod="setDeleteWorkDirOnContextDestroy">
+     <name>DeleteWorkDirOnContextDestroy</name>
+     <type>boolean</type>
+   </attribute>
+
    <attribute access="read-write" getMethod="getSubjectAttributeName" setMethod="setSubjectAttributeName">
      <name>SubjectAttributeName</name>
      <type>java.lang.String</type>
@@ -164,4 +170,4 @@
    &defaultOperations;
    &interceptable;    
    
-</mbean>
\ No newline at end of file
+</mbean>




More information about the jboss-cvs-commits mailing list