[jboss-cvs] JBossAS SVN: r92318 - in branches/JBPAPP_5_0: system/src/main/org/jboss/system/deployers and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 13 17:36:08 EDT 2009


Author: jason.greene at jboss.com
Date: 2009-08-13 17:36:07 -0400 (Thu, 13 Aug 2009)
New Revision: 92318

Added:
   branches/JBPAPP_5_0/system/src/main/org/jboss/system/deployers/vfs/
   branches/JBPAPP_5_0/system/src/main/org/jboss/system/deployers/vfs/ArchiveForceTempTypeMatcher.java
Modified:
   branches/JBPAPP_5_0/server/src/etc/conf/all/bootstrap/deployers.xml
Log:
Always copy packed archive deployments to the tmp dir
Should resolve JBPAPP-2151 


Modified: branches/JBPAPP_5_0/server/src/etc/conf/all/bootstrap/deployers.xml
===================================================================
--- branches/JBPAPP_5_0/server/src/etc/conf/all/bootstrap/deployers.xml	2009-08-13 21:22:14 UTC (rev 92317)
+++ branches/JBPAPP_5_0/server/src/etc/conf/all/bootstrap/deployers.xml	2009-08-13 21:36:07 UTC (rev 92318)
@@ -17,10 +17,13 @@
       <root>${jboss.lib.url}jboss-deployers-impl.jar</root>
       <root>${jboss.lib.url}jboss-deployers-vfs-spi.jar</root>
       <root>${jboss.lib.url}jboss-deployers-vfs.jar</root>
-     <!-- Bean annotation handling -->
+      <!-- Bean annotation handling -->
       <root>${jboss.lib.url}jboss-dependency.jar</root>
       <root>${jboss.lib.url}jboss-kernel.jar</root>
 
+      <!-- Needed for ArchiveForceTempTypeMatcher -->
+      <root>${jboss.lib.url}jboss-system.jar</root>
+
       <!-- JAXB impl here, api is in endorsed -->
       <root>${jboss.lib.url}jaxb-impl.jar</root>
       <!-- STAX2 impl here, api is in endorsed -->
@@ -34,7 +37,7 @@
 
    <!-- MetaValueFactory -->
    <bean name="MetaValueFactory" >
-      <constructor factoryClass="org.jboss.metatype.api.values.MetaValueFactory" factoryMethod="getInstance"/>      
+      <constructor factoryClass="org.jboss.metatype.api.values.MetaValueFactory" factoryMethod="getInstance"/>
    </bean>
    <!-- The ManagedObjectFactory -->
    <bean name="ManagedObjectFactory">
@@ -71,6 +74,15 @@
      <uncallback method="removeMatcher"/>
    </bean>
 
+   <!-- Always copy archives (non-exploded jar/war/ear) to tmp.
+       There are 2 very important reasons why this needs to be done:
+
+       1. Windows File Locking - An open file on windows can not be deleted </li>
+       2. Zlib (all platforms) - causes jvm segfaults when the contents of the jar change unexpectedly
+               (during a user copy)
+   -->
+   <bean name="ArchiveForceTempTypeMatcher" class="org.jboss.system.deployers.vfs.ArchiveForceTempTypeMatcher"/>
+
    <!-- The holder for deployers that determine structure -->
    <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
       <property name="structureBuilder">
@@ -149,7 +161,7 @@
        </constructor>
     </bean>
 
-    <!-- Old AOP deployment 
+    <!-- Old AOP deployment
     <bean name="AspectAppParsingDeployer" class="org.jboss.aop.asintegration.jboss5.AspectAppParsingDeployer"/>
     <bean name="AspectDeployer" class="org.jboss.aop.asintegration.jboss5.AspectDeployer">
        <property name="aspectManager"><inject bean="AspectManager" property="aspectManager"/></property>
@@ -180,7 +192,7 @@
    </bean>
 
    <!-- POJO Deployment -->
-  
+
    <bean name="CoreBeanAnnotationAdapterFactory">
       <constructor factoryClass="org.jboss.kernel.plugins.annotations.BeanAnnotationAdapterFactory" factoryMethod="getInstance"/>
    </bean>
@@ -215,7 +227,7 @@
       <uninstall bean="ManagedDeploymentCreator" method="removeAttachmentType">
          <parameter>
             <value>org.jboss.kernel.spi.deployment.KernelDeployment</value>
-         </parameter>        
+         </parameter>
       </uninstall>
       <property name="mgtObjectCreator"><inject bean="KernelDeploymentManagedObjectCreator"/></property>
    </bean>
@@ -256,5 +268,5 @@
       <property name="classLoading"><inject bean="ClassLoading"/></property>
       <property name="system"><inject bean="ClassLoaderSystem"/></property>
    </bean>
-   
+
 </deployment>

Added: branches/JBPAPP_5_0/system/src/main/org/jboss/system/deployers/vfs/ArchiveForceTempTypeMatcher.java
===================================================================
--- branches/JBPAPP_5_0/system/src/main/org/jboss/system/deployers/vfs/ArchiveForceTempTypeMatcher.java	                        (rev 0)
+++ branches/JBPAPP_5_0/system/src/main/org/jboss/system/deployers/vfs/ArchiveForceTempTypeMatcher.java	2009-08-13 21:36:07 UTC (rev 92318)
@@ -0,0 +1,65 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.system.deployers.vfs;
+
+import java.io.IOException;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.ModificationType;
+import org.jboss.deployers.vfs.plugins.structure.modify.AbstractModificationTypeMatcher;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Forces all archive deployments (jar, war, ear, etc) to be copied to the temp directory.
+ * <p>
+ * There are 2 very important reasons why this needs to be done:
+ *
+ * <ol>
+ * <li> Windows File Locking - An open file can not be deleted </li>
+ * <li> Zlib - causes jvm segfaults when the contents of the jar change unexpectedly
+ *      (during a user copy) </li>
+ * </ol>
+ *
+ * @author Jason T. Greene
+ */
+public class ArchiveForceTempTypeMatcher extends AbstractModificationTypeMatcher
+{
+   public ArchiveForceTempTypeMatcher()
+   {
+      setModificationType(ModificationType.TEMP);
+      setTopLevelOnly(true);
+   }
+
+   protected boolean isModificationDetermined(VirtualFile file, ContextInfo contextInfo)
+   {
+      try
+      {
+         return file.isArchive();
+      }
+      catch (IOException e)
+      {
+         // Will never happen
+         return false;
+      }
+   }
+
+}


Property changes on: branches/JBPAPP_5_0/system/src/main/org/jboss/system/deployers/vfs/ArchiveForceTempTypeMatcher.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF




More information about the jboss-cvs-commits mailing list