[jboss-cvs] JBossAS SVN: r109873 - in trunk: system/src/main/java/org/jboss/system/deployers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Dec 13 07:54:28 EST 2010


Author: alesj
Date: 2010-12-13 07:54:28 -0500 (Mon, 13 Dec 2010)
New Revision: 109873

Added:
   trunk/system/src/main/java/org/jboss/system/deployers/ExcludeArchiveMatcher.java
Modified:
   trunk/server/src/etc/conf/all/bootstrap/deployers.xml
Log:
[JBAS-8725]; ignore classpath entries starting with . or ending with .bak

Modified: trunk/server/src/etc/conf/all/bootstrap/deployers.xml
===================================================================
--- trunk/server/src/etc/conf/all/bootstrap/deployers.xml	2010-12-13 12:50:41 UTC (rev 109872)
+++ trunk/server/src/etc/conf/all/bootstrap/deployers.xml	2010-12-13 12:54:28 UTC (rev 109873)
@@ -162,6 +162,19 @@
        </constructor>
     </bean>
 
+      <bean name="ExcludeArchiveMatcher" class="org.jboss.system.deployers.ExcludeArchiveMatcher">
+         <property name="suffixes">
+            <set>
+               <value>.</value>
+            </set>
+         </property>
+         <property name="prefixes">
+            <set>
+               <value>.bak</value>
+            </set>
+         </property>
+      </bean>
+
     <!-- Ignore config files via jboss-ignore.txt -->
 
     <bean name="IgnoreFilesDeployer" class="org.jboss.deployers.vfs.spi.deployer.AbstractIgnoreFilesDeployer"/>
@@ -276,7 +289,9 @@
          <classloading xmlns="urn:jboss:classloading:1.0" export-all="NON_EMPTY" import-all="true"/>
       </property>
    </bean>
-   <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer"/>
+   <bean name="ClassLoaderClassPathDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderClassPathDeployer">
+      <property name="archiveMatcher"><inject bean="ExcludeArchiveMatcher"/></property>
+   </bean>
    <bean name="ClassLoaderDescribeDeployer" class="org.jboss.deployers.vfs.plugins.classloader.VFSClassLoaderDescribeDeployer">
       <property name="classLoading"><inject bean="ClassLoading"/></property>
    </bean>

Copied: trunk/system/src/main/java/org/jboss/system/deployers/ExcludeArchiveMatcher.java (from rev 109825, trunk/system/src/main/java/org/jboss/system/deployers/LegacyDeploymentContextComparator.java)
===================================================================
--- trunk/system/src/main/java/org/jboss/system/deployers/ExcludeArchiveMatcher.java	                        (rev 0)
+++ trunk/system/src/main/java/org/jboss/system/deployers/ExcludeArchiveMatcher.java	2010-12-13 12:54:28 UTC (rev 109873)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2006, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file 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;
+
+import java.util.Set;
+
+import org.jboss.deployers.vfs.spi.deployer.ArchiveMatcher;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * Exclude non-archives based on suffix or prefix.
+ *
+ * @author ales.justin at jboss.org
+ */
+public class ExcludeArchiveMatcher implements ArchiveMatcher
+{
+   private Set<String> suffixes;
+   private Set<String> prefixes;
+
+   public boolean isArchive(VirtualFile file)
+   {
+      return hasArchiveSuffix(file);
+   }
+
+   public boolean hasArchiveSuffix(VirtualFile file)
+   {
+      return hasArchiveSuffix(file.getName());
+   }
+
+   public boolean hasArchiveSuffix(String fileName)
+   {
+      if (suffixes != null)
+      {
+         for (String suffix : suffixes)
+            if (fileName.startsWith(suffix))
+               return false;
+      }
+      if (prefixes != null)
+      {
+         for (String prefix : prefixes)
+            if (fileName.endsWith(prefix))
+               return false;
+      }
+      return true;
+   }
+
+   public void setSuffixes(Set<String> suffixes)
+   {
+      this.suffixes = suffixes;
+   }
+
+   public void setPrefixes(Set<String> prefixes)
+   {
+      this.prefixes = prefixes;
+   }
+}
\ No newline at end of file



More information about the jboss-cvs-commits mailing list