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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jun 16 09:49:16 EDT 2008


Author: alesj
Date: 2008-06-16 09:49:15 -0400 (Mon, 16 Jun 2008)
New Revision: 74615

Added:
   trunk/system/src/main/org/jboss/system/deployers/LegacyDeploymentContextComparator.java
Removed:
   trunk/system/src/main/org/jboss/system/deployers/DsDeploymentContextComparator.java
Modified:
   trunk/component-matrix/pom.xml
   trunk/server/src/etc/conf/default/deployers.xml
   trunk/server/src/etc/deployers/ear-deployer-beans.xml
   trunk/server/src/main/org/jboss/deployment/EARStructure.java
   trunk/testsuite/build.xml
   trunk/testsuite/src/main/org/jboss/test/security/service/HttpsClient.java
   trunk/testsuite/src/resources/deployers/ear1/META-INF/application.xml
   trunk/testsuite/src/resources/deployers/ear1/META-INF/jboss-app.xml
Log:
Update VFS to 2.0.0.Beta16 and Deployers 2.0.0.Beta17.
Add context comparator to EAR structure - rar and -ds legacy order.
Fix EAR deployment test - missing modules metadata.
Add VFS forceCopy flags to tests client side.

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/component-matrix/pom.xml	2008-06-16 13:49:15 UTC (rev 74615)
@@ -39,10 +39,10 @@
     <version.org.jboss.aop>2.0.0.CR12</version.org.jboss.aop>
     <version.org.jboss.ejb3>0.1.4</version.org.jboss.ejb3>
     <version.org.jboss.mdr>2.0.0.Beta15</version.org.jboss.mdr>
-    <version.org.jboss.vfs>2.0.0.Beta15</version.org.jboss.vfs>
+    <version.org.jboss.vfs>2.0.0.Beta16</version.org.jboss.vfs>
     <version.org.jboss.cl>2.0.0.Beta12</version.org.jboss.cl>
     <version.org.jboss.cluster>1.1.0.CR1</version.org.jboss.cluster>
-    <version.org.jboss.deployers>2.0.0.Beta16</version.org.jboss.deployers>
+    <version.org.jboss.deployers>2.0.0.Beta17</version.org.jboss.deployers>
     <version.org.jboss.integration>5.0.0.Beta5</version.org.jboss.integration>
     <version.org.jboss.jbossxb>2.0.0.CR10</version.org.jboss.jbossxb>
     <version.org.jboss.man>2.0.0.Beta15</version.org.jboss.man>

Modified: trunk/server/src/etc/conf/default/deployers.xml
===================================================================
--- trunk/server/src/etc/conf/default/deployers.xml	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/server/src/etc/conf/default/deployers.xml	2008-06-16 13:49:15 UTC (rev 74615)
@@ -21,15 +21,17 @@
       -->
    </classloader>
 
-  <!-- put -ds.xml before everything -->
-   <bean name="dsContextComparator" class="org.jboss.system.deployers.DsDeploymentContextComparator"/>
+  <!-- use legacy ordering -->
+   <bean name="topContextComparator">
+     <constructor factoryClass="org.jboss.system.deployers.LegacyDeploymentContextComparator" factoryMethod="getInstance"/>
+   </bean>
 
    <!-- The MainDeployer -->
    <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
       <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
       <property name="deployers"><inject bean="Deployers"/></property>
       <property name="mgtDeploymentCreator"><inject bean="ManagedDeploymentCreator"/></property>
-      <property name="comparator"><inject bean="dsContextComparator"/></property>
+      <property name="comparator"><inject bean="topContextComparator"/></property>
    </bean>
 
    <!-- The ManagedDeploymentCreator implementation that supports mapping

Modified: trunk/server/src/etc/deployers/ear-deployer-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/ear-deployer-beans.xml	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/server/src/etc/deployers/ear-deployer-beans.xml	2008-06-16 13:49:15 UTC (rev 74615)
@@ -6,7 +6,9 @@
 -->
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
 
-   <bean name="EARStructureDeployer" class="org.jboss.deployment.EARStructure"/>
+   <bean name="EARStructureDeployer" class="org.jboss.deployment.EARStructure">
+     <property name="comparatorClassName">org.jboss.system.deployers.LegacyDeploymentContextComparator</property>
+   </bean>
 
    <!-- application.xml parsing deployer -->
    <bean name="AppParsingDeployer" class="org.jboss.deployment.AppParsingDeployer">

Modified: trunk/server/src/main/org/jboss/deployment/EARStructure.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/EARStructure.java	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/server/src/main/org/jboss/deployment/EARStructure.java	2008-06-16 13:49:15 UTC (rev 74615)
@@ -73,6 +73,8 @@
    private SchemaBindingResolver resolver = SingletonSchemaResolverFactory.getInstance().getSchemaBindingResolver();
    /** The root in classpath flag */
    private boolean includeEarRootInClasspath = true;
+   /** The ear child context comparator */
+   private String comparatorClassName;
 
    /**
     * Set the relative order to 1000 by default
@@ -133,6 +135,7 @@
             return false;
 
          context = createContext(file, "META-INF", metaData);
+         context.setComparatorClassName(comparatorClassName);
 
          VirtualFile applicationXml = getMetaDataFile(file, "META-INF/application.xml");
          VirtualFile jbossAppXml = getMetaDataFile(file, "META-INF/jboss-app.xml");
@@ -424,4 +427,9 @@
    {
       this.includeEarRootInClasspath = includeEarRootInClasspath;
    }
+
+   public void setComparatorClassName(String comparatorClassName)
+   {
+      this.comparatorClassName = comparatorClassName;
+   }
 }

Deleted: trunk/system/src/main/org/jboss/system/deployers/DsDeploymentContextComparator.java
===================================================================
--- trunk/system/src/main/org/jboss/system/deployers/DsDeploymentContextComparator.java	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/system/src/main/org/jboss/system/deployers/DsDeploymentContextComparator.java	2008-06-16 13:49:15 UTC (rev 74615)
@@ -1,47 +0,0 @@
-/*
-* 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 org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.deployers.structure.spi.helpers.DefaultDeploymentContextComparator;
-
-/**
- * Put any -ds.xml before anything else.
- *
- * @author ales.justin at jboss.org
- */
-public class DsDeploymentContextComparator extends DefaultDeploymentContextComparator
-{
-   private static final String DS_SUFFIX = "-ds.xml";
-
-   public int compare(DeploymentContext fst, DeploymentContext snd)
-   {
-      String fstSimpleName = fst.getSimpleName();
-      String sndSimpleName = snd.getSimpleName();
-      if (fstSimpleName.endsWith(DS_SUFFIX))
-         return -1;
-      if (sndSimpleName.endsWith(DS_SUFFIX))
-         return 1;
-
-      return super.compare(fst, snd);
-   }
-}
\ No newline at end of file

Copied: trunk/system/src/main/org/jboss/system/deployers/LegacyDeploymentContextComparator.java (from rev 74599, trunk/system/src/main/org/jboss/system/deployers/DsDeploymentContextComparator.java)
===================================================================
--- trunk/system/src/main/org/jboss/system/deployers/LegacyDeploymentContextComparator.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/deployers/LegacyDeploymentContextComparator.java	2008-06-16 13:49:15 UTC (rev 74615)
@@ -0,0 +1,155 @@
+/*
+* 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.HashMap;
+import java.util.Map;
+
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.helpers.DefaultDeploymentContextComparator;
+
+/**
+ * Legacy deployment sorter
+ *
+ * @author ales.justin at jboss.org
+ * @see org.jboss.deployment.DeploymentSorter in system-jmx
+ * @see org.jboss.deployment.SuffixOrderHelper in system-jmx
+ */
+public class LegacyDeploymentContextComparator extends DefaultDeploymentContextComparator
+{
+   /** The instance */
+   public static final LegacyDeploymentContextComparator INSTANCE = new LegacyDeploymentContextComparator();
+   /** Legacy orders */
+   private static Map<String, Integer> legacyOrder;
+
+   static
+   {
+      legacyOrder = new HashMap<String, Integer>();
+      legacyOrder.put(".deployer", 50);
+      legacyOrder.put("-deployer.xml", 50);
+      legacyOrder.put(".aop", 100);
+      legacyOrder.put("-aop.xml", 100);
+      legacyOrder.put(".sar", 150);
+      legacyOrder.put("-service.xml", 150);
+      legacyOrder.put(".beans", 200);
+      legacyOrder.put(".rar", 250);
+      legacyOrder.put("-ds.xml", 300);
+      legacyOrder.put(".har", 350);
+      legacyOrder.put(".jar", 400);
+      legacyOrder.put(".ejb3", 400);
+      legacyOrder.put(".par", 400);
+      legacyOrder.put(".war", 500);
+      legacyOrder.put(".wsr", 600);
+      legacyOrder.put(".ear", 650);
+      legacyOrder.put(".jar", 700);
+      legacyOrder.put(".zip", 750);
+      legacyOrder.put(".bsh", 800);
+      legacyOrder.put(".last", 900);
+   }
+
+   private boolean useDefaults = true;
+   private Map<String, Integer> suffixOrder;
+   private int defaultOrder = 850;
+
+   /**
+    * Get the instance.
+    *
+    * @return the instance
+    */
+   public static LegacyDeploymentContextComparator getInstance()
+   {
+      return INSTANCE;
+   }
+
+   public int compare(DeploymentContext fst, DeploymentContext snd)
+   {
+      int fstOrder = getContextOrder(fst);
+      int sndOrder = getContextOrder(snd);
+      int diff = fstOrder - sndOrder;
+      if (diff != 0)
+         return diff;
+      else
+         return super.compare(fst, snd);
+   }
+
+   /**
+    * Get context's order.
+    *
+    * @param context the deployment context
+    * @return context's order, or default if no match
+    */
+   protected int getContextOrder(DeploymentContext context)
+   {
+      String simpleName = context.getSimpleName();
+      for (Map.Entry<String, Integer> entry : suffixOrder.entrySet())
+      {
+         if (simpleName.endsWith(entry.getKey()))
+            return entry.getValue();
+      }
+      return defaultOrder;
+   }
+
+   public void create()
+   {
+      Map<String, Integer> map = new HashMap<String, Integer>();
+      if (useDefaults)
+         map.putAll(legacyOrder);
+      if (suffixOrder != null)
+         map.putAll(suffixOrder);
+      suffixOrder = map;
+   }
+
+   /**
+    * Should we use defaults.
+    *
+    * @param useDefaults default flag
+    */
+   public void setUseDefaults(boolean useDefaults)
+   {
+      this.useDefaults = useDefaults;
+   }
+
+   /**
+    * Set suffix order map.
+    *
+    * @param suffixOrder the suffix order map
+    */
+   public void setSuffixOrder(Map<String, Integer> suffixOrder)
+   {
+      this.suffixOrder = suffixOrder;
+   }
+
+   /**
+    * Set default order.
+    *
+    * @param defaultOrder the default order
+    */
+   public void setDefaultOrder(int defaultOrder)
+   {
+      this.defaultOrder = defaultOrder;
+   }
+
+   Object readResolve()
+   {
+      return INSTANCE;
+   }
+}
\ No newline at end of file

Modified: trunk/testsuite/build.xml
===================================================================
--- trunk/testsuite/build.xml	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/testsuite/build.xml	2008-06-16 13:49:15 UTC (rev 74615)
@@ -2799,6 +2799,7 @@
          <sysproperty key="java.security.auth.login.config"
             value="${build.resources}/security/auth.conf"/>
          <sysproperty key="java.protocol.handler.pkgs" value="org.jboss.virtual.protocol"/>
+         <sysproperty key="jboss.vfs.forceCopy" value="true"/>
 
          <classpath>
             <pathelement location="${build.classes}"/>
@@ -2938,7 +2939,7 @@
          <sysproperty key="javax.net.ssl.trustStore"
             value="${build.resources}/security/tst.keystore"/>
          <sysproperty key="org.jboss.security.ignoreHttpsHost" value="true"/>
-         <!-- <sysproperty key="jboss.vfs.forceNoCopy" value="true"/> -->
+         <sysproperty key="jboss.vfs.forceCopy" value="true"/>
 
          <classpath>
             <pathelement location="${build.classes}"/>

Modified: trunk/testsuite/src/main/org/jboss/test/security/service/HttpsClient.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/security/service/HttpsClient.java	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/testsuite/src/main/org/jboss/test/security/service/HttpsClient.java	2008-06-16 13:49:15 UTC (rev 74615)
@@ -152,7 +152,7 @@
       if (keyStoreURL.getProtocol().equals("vfszip"))
       {
          VirtualFileURLConnection conn = (VirtualFileURLConnection) keyStoreURL.openConnection();
-         VirtualFile vf = conn.getVirtualFile();
+         VirtualFile vf = conn.getContent();
          InputStream is = vf.openStream();
          File tmp = File.createTempFile("tst-", ".keystore");
          tmp.deleteOnExit();

Modified: trunk/testsuite/src/resources/deployers/ear1/META-INF/application.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/ear1/META-INF/application.xml	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/testsuite/src/resources/deployers/ear1/META-INF/application.xml	2008-06-16 13:49:15 UTC (rev 74615)
@@ -11,6 +11,14 @@
 
    <module><ejb>testdeployers-bean1ejb.jar</ejb></module>
    <module><ejb>testdeployers-client1.jar</ejb></module>
+   <module><connector>testdeployers-mcf1.rar</connector></module>
+   <module>
+      <web>
+         <web-uri>testdeployers-web1.war</web-uri>
+        <context-root>/testdeployers-web1</context-root>
+      </web>
+   </module>
+   <module><java>testdeployers-mbean1.sar</java></module>
 
 </application>
 

Modified: trunk/testsuite/src/resources/deployers/ear1/META-INF/jboss-app.xml
===================================================================
--- trunk/testsuite/src/resources/deployers/ear1/META-INF/jboss-app.xml	2008-06-16 13:49:07 UTC (rev 74614)
+++ trunk/testsuite/src/resources/deployers/ear1/META-INF/jboss-app.xml	2008-06-16 13:49:15 UTC (rev 74615)
@@ -8,5 +8,6 @@
 <jboss-app>
 
    <module><service>testdeployers-mcf1-ds.xml</service></module>
-   
+   <module><service>testdeployers-1-service.xml</service></module>
+
 </jboss-app>




More information about the jboss-cvs-commits mailing list