[jboss-cvs] JBossAS SVN: r81687 - in trunk: server/src/etc/conf/default/bootstrap and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Nov 26 18:42:25 EST 2008


Author: alesj
Date: 2008-11-26 18:42:24 -0500 (Wed, 26 Nov 2008)
New Revision: 81687

Added:
   trunk/server/src/etc/deployers/dependency-deployers-jboss-beans.xml
   trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
   trunk/server/src/main/org/jboss/deployment/JBossMetaDataDeploymentUnitFilter.java
   trunk/server/src/main/org/jboss/deployment/ListDeploymentUnitFilter.java
Modified:
   trunk/component-matrix/pom.xml
   trunk/server/src/etc/conf/default/bootstrap/vfs.xml
   trunk/server/src/etc/deployers/metadata-deployer-jboss-beans.xml
Log:
[JBAS-6045, JBAS-6048, JBAS-6051]; MC Kernel, CL, Deployers update.
Filter scanning.
Adding generic dependency deployers.

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2008-11-26 22:52:57 UTC (rev 81686)
+++ trunk/component-matrix/pom.xml	2008-11-26 23:42:24 UTC (rev 81687)
@@ -62,9 +62,9 @@
     <version.org.jboss.vfs>2.0.0.GA</version.org.jboss.vfs>
     <version.org.jboss.mdr>2.0.1.GA</version.org.jboss.mdr>
     <version.org.jboss.man>2.0.0.GA</version.org.jboss.man>
-    <version.org.jboss.microcontainer>2.0.0.CR5</version.org.jboss.microcontainer>
-    <version.org.jboss.cl>2.0.0.CR5</version.org.jboss.cl>
-    <version.org.jboss.deployers>2.0.0.CR5</version.org.jboss.deployers>
+    <version.org.jboss.microcontainer>2.0.1.GA</version.org.jboss.microcontainer>
+    <version.org.jboss.cl>2.0.0.GA</version.org.jboss.cl>
+    <version.org.jboss.deployers>2.0.0.GA</version.org.jboss.deployers>
     <version.org.jboss.cache.core>3.0.1.CR2</version.org.jboss.cache.core>
     <version.org.jboss.cache.pojo>3.0.0.GA</version.org.jboss.cache.pojo>
     <version.org.jboss.cluster>1.1.0.GA</version.org.jboss.cluster>

Modified: trunk/server/src/etc/conf/default/bootstrap/vfs.xml
===================================================================
--- trunk/server/src/etc/conf/default/bootstrap/vfs.xml	2008-11-26 22:52:57 UTC (rev 81686)
+++ trunk/server/src/etc/conf/default/bootstrap/vfs.xml	2008-11-26 23:42:24 UTC (rev 81687)
@@ -19,7 +19,7 @@
   </bean>
   
   <bean name="JBossVFSInitializer" class="org.jboss.virtual.plugins.cache.PreInitializeVFSContexts">
-    <property name="initializedVFSContexts">
+    <property name="initializedVFSContexts" class="java.util.Map">
       <map keyClass="java.net.URL" valueClass="org.jboss.virtual.spi.ExceptionHandler">
         <entry>
           <key>${jboss.lib.url}</key>

Added: trunk/server/src/etc/deployers/dependency-deployers-jboss-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/dependency-deployers-jboss-beans.xml	                        (rev 0)
+++ trunk/server/src/etc/deployers/dependency-deployers-jboss-beans.xml	2008-11-26 23:42:24 UTC (rev 81687)
@@ -0,0 +1,18 @@
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+  <!-- Generic dependency deployer -->
+
+  <!-- aliases.txt -->
+  <bean name="DeploymentAliasesParserDeployer" class="org.jboss.deployers.vfs.plugins.dependency.AliasesParserDeployer"/>
+  <bean name="DeploymentAliasesDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DeploymentAliasesDeployer">
+    <constructor>
+      <parameter><inject bean="jboss.kernel:service=KernelController"/></parameter>
+    </constructor>
+  </bean>
+
+  <!-- jboss-dependency.xml -->
+  <bean name="DependenciesParserDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DependenciesParserDeployer"/>
+  <bean name="DependenciesMDDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaDataDeployer"/>
+  <bean name="DeploymentDependenciesDeployer" class="org.jboss.deployers.vfs.plugins.dependency.DeploymentDependencyDeployer"/>
+
+</deployment>

Modified: trunk/server/src/etc/deployers/metadata-deployer-jboss-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/metadata-deployer-jboss-beans.xml	2008-11-26 22:52:57 UTC (rev 81686)
+++ trunk/server/src/etc/deployers/metadata-deployer-jboss-beans.xml	2008-11-26 23:42:24 UTC (rev 81687)
@@ -15,8 +15,80 @@
   
    <bean name="EarLibExcludeDeployer" class="org.jboss.deployment.EarLibExcludeDeployer"/>
 
-   <bean name="GenScanDeployer" class="org.jboss.deployers.vfs.plugins.annotations.FilteredAnnotationEnvironmentDeployer"/>
+   <bean name="JBossMetaDataDUFilter" class="org.jboss.deployment.JBossMetaDataDeploymentUnitFilter"/>
 
+  <bean name="ScanningMetaDataDeployer" class="org.jboss.deployers.vfs.plugins.annotations.ScanningMetaDataDeployer"/>
+  <bean name="ScanningMetaDataDUFilter" class="org.jboss.deployers.vfs.plugins.annotations.ScanningDeploymentUnitFilter"/>
+
+  <bean name="JBossCustomDeployDUFilter" class="org.jboss.deployers.vfs.spi.structure.helpers.VirtualFileDeploymentUnitFilter">
+    <constructor>
+      <parameter>
+        <bean class="org.jboss.deployment.FileNameVirtualFileFilter">
+          <constructor>
+            <parameter>
+              <map keyClass="java.lang.String" valueClass="java.util.Set">
+                <entry>
+                  <key>jbossweb.sar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>console-mgr.sar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>jbossws.sar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>jmx-remoting.sar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>jboss-local-jdbc.rar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>jboss-xa-jdbc.rar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>jms-ra.rar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>mail-ra.rar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>quartz-ra.rar</key>
+                  <value><null/></value>
+                </entry>
+                <entry>
+                  <key>jmx-console.war</key>
+                  <value><null/></value>
+                </entry>
+              </map>
+            </parameter>
+          </constructor>
+        </bean>
+      </parameter>
+    </constructor>
+  </bean>
+
+  <bean name="GenScanDeployer" class="org.jboss.deployers.vfs.plugins.annotations.FilteredAnnotationEnvironmentDeployer">
+    <property name="filter">
+      <bean class="org.jboss.deployment.ListDeploymentUnitFilter">
+        <property name="filters">
+          <list>
+            <inject bean="JBossMetaDataDUFilter"/>
+            <inject bean="ScanningMetaDataDUFilter"/>
+            <inject bean="JBossCustomDeployDUFilter"/>
+          </list>
+        </property>
+      </bean>
+    </property>
+  </bean>
+
    <bean name="AnnotationMetaDataDeployer" class="org.jboss.deployment.OptAnnotationMetaDataDeployer">
       <property name="metaDataCompleteIsDefault">false</property>
    </bean>

Copied: trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java (from rev 80791, trunk/server/src/main/org/jboss/deployment/EarLibExcludeDeployer.java)
===================================================================
--- trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java	                        (rev 0)
+++ trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java	2008-11-26 23:42:24 UTC (rev 81687)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.deployment;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+
+/**
+ * Exclude virtual file by file name and path.
+ *
+ * @author ales.justin at jboss.org
+ */
+public class FileNameVirtualFileFilter implements VirtualFileFilter
+{
+   private Logger log = Logger.getLogger(getClass());
+   private Map<String, Set<String>> excludes;
+
+   public FileNameVirtualFileFilter(Map<String, Set<String>> excludes)
+   {
+      if (excludes == null || excludes.isEmpty())
+         throw new IllegalArgumentException("Null or empty excludes.");
+
+      this.excludes = excludes;
+   }
+
+   /**
+    * Do we accept file.
+    *
+    * If pathName contains any of the keys,
+    *   * if the value is null - then do exclude
+    *   * if value is not null - only exclude if it value contains simple name
+    *
+    * @param file the virtual file
+    * @return false if file is excluded by excludes map, true other wise
+    */
+   public boolean accepts(VirtualFile file)
+   {
+      String pathName = file.getPathName();
+      for (Map.Entry<String, Set<String>> entry : excludes.entrySet())
+      {
+         String key = entry.getKey();
+         if (pathName.contains(key))
+         {
+            String simpleName = file.getName();
+            Set<String> value = entry.getValue();
+            if (value == null || value.contains(simpleName))
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Excluding " + pathName);
+               
+               return false;
+            }
+         }
+      }
+      return true;
+   }
+}
\ No newline at end of file


Property changes on: trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:mergeinfo
   + 

Added: trunk/server/src/main/org/jboss/deployment/JBossMetaDataDeploymentUnitFilter.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossMetaDataDeploymentUnitFilter.java	                        (rev 0)
+++ trunk/server/src/main/org/jboss/deployment/JBossMetaDataDeploymentUnitFilter.java	2008-11-26 23:42:24 UTC (rev 81687)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.deployment;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.helpers.VFS2BaseBridgeDeploymentUnitFilter;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+
+/**
+ * Check jboss metadata for completeness.
+ *
+ * @author ales.justin at jboss.org
+ */
+public class JBossMetaDataDeploymentUnitFilter extends VFS2BaseBridgeDeploymentUnitFilter
+{
+   protected boolean doAccepts(DeploymentUnit unit)
+   {
+      // ejbs
+      JBossMetaData jbm = unit.getAttachment(JBossMetaData.class);
+      if (jbm != null && jbm.isMetadataComplete())
+         return false;
+
+      // wars
+      JBossWebMetaData jwbm = unit.getAttachment(JBossWebMetaData.class);
+      if (jwbm != null && jwbm.isMetadataComplete())
+         return false;
+
+      return true;
+   }
+}
\ No newline at end of file

Added: trunk/server/src/main/org/jboss/deployment/ListDeploymentUnitFilter.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/ListDeploymentUnitFilter.java	                        (rev 0)
+++ trunk/server/src/main/org/jboss/deployment/ListDeploymentUnitFilter.java	2008-11-26 23:42:24 UTC (rev 81687)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, 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.deployment;
+
+import java.util.List;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnitFilter;
+
+/**
+ * ListDeploymentUnitFilter
+ *
+ * @author ales.justin at jboss.org
+ */
+public class ListDeploymentUnitFilter implements VFSDeploymentUnitFilter
+{
+   private List<VFSDeploymentUnitFilter> filters;
+
+   /**
+    * Check filters list.
+    */
+   public void start()
+   {
+      if (filters == null || filters.isEmpty())
+         throw new IllegalArgumentException("Null or empty filters list.");
+   }
+
+   public boolean accepts(VFSDeploymentUnit unit)
+   {
+      for (VFSDeploymentUnitFilter filter : filters)
+      {
+         if (filter.accepts(unit) == false)
+            return false;
+      }
+      return true;
+   }
+
+   /**
+    * Set list of filters.
+    *
+    * @param filters the filters
+    */
+   public void setFilters(List<VFSDeploymentUnitFilter> filters)
+   {
+      this.filters = filters;
+   }
+}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list