[jboss-cvs] JBossAS SVN: r67909 - in trunk/server/src: main/org/jboss/deployment and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Dec 4 16:44:40 EST 2007


Author: scott.stark at jboss.org
Date: 2007-12-04 16:44:40 -0500 (Tue, 04 Dec 2007)
New Revision: 67909

Modified:
   trunk/server/src/etc/deployers/ejb-deployer-beans.xml
   trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
Log:
Add standardJBossXmlPath and ignoreMissingStandardJBossXml properties to control location and need for standardjboss.xml


Modified: trunk/server/src/etc/deployers/ejb-deployer-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/ejb-deployer-beans.xml	2007-12-04 19:40:41 UTC (rev 67908)
+++ trunk/server/src/etc/deployers/ejb-deployer-beans.xml	2007-12-04 21:44:40 UTC (rev 67909)
@@ -16,6 +16,9 @@
       <property name="type">ejb2x</property>      
       <property name="relativeOrder">3001</property>
       <property name="useSchemaValidation">false</property>
+      <property name="ignoreMissingStandardJBossXml">false</property>
+      <!-- Can be used to override the default location of the standardjboss.xml -->
+      <property name="standardJBossXmlPath">${jboss.server.config.url}/standardjboss.xml</property>
    </bean>
 
     <bean name="EJB2xDeployer" class="org.jboss.ejb.deployers.EjbDeployer">

Modified: trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java	2007-12-04 19:40:41 UTC (rev 67908)
+++ trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java	2007-12-04 21:44:40 UTC (rev 67909)
@@ -53,6 +53,10 @@
 public class JBossEjbParsingDeployer extends SchemaResolverDeployer<JBossMetaData>
 {
    private JBossMetaData standardMetaData;
+   /** URL to standardjboss.xml */
+   private URL standardJBossXmlPath;
+   /** Whether a missing standardjboss.xml should be ignored */
+   private boolean ignoreMissingStandardJBossXml = false;
 
    /**
     * Create a new JBossEjbParsingDeployer.
@@ -73,6 +77,26 @@
       addOutput(LoaderRepositoryConfig.class);
    }
 
+   public URL getStandardJBossXmlPath()
+   {
+      return standardJBossXmlPath;
+   }
+   public void setStandardJBossXmlPath(URL standardJBossXmlPath)
+   {
+      this.standardJBossXmlPath = standardJBossXmlPath;
+   }
+
+
+   public boolean isIgnoreMissingStandardJBossXml()
+   {
+      return ignoreMissingStandardJBossXml;
+   }
+   public void setIgnoreMissingStandardJBossXml(
+         boolean ignoreMissingStandardJBossXml)
+   {
+      this.ignoreMissingStandardJBossXml = ignoreMissingStandardJBossXml;
+   }
+
    // FIXME This should not be here 
    @Override
    protected void createMetaData(DeploymentUnit unit, String name, String suffix)
@@ -166,13 +190,21 @@
       {
          try
          {
-            String configPath = System.getProperty(ServerConfig.SERVER_CONFIG_URL);
-            URL configUrl = new URL(configPath);
-            VirtualFile stdJBoss = VFS.getVirtualFile(configUrl, "standardjboss.xml");
-            if (stdJBoss == null)
+            if(standardJBossXmlPath == null)
             {
-               throw new DeploymentException("standardjboss.xml not found in config dir: " + configPath);
+               // Use default server conf/standardjboss.xml location
+               String configPath = System.getProperty(ServerConfig.SERVER_CONFIG_URL);
+               if(configPath == null && ignoreMissingStandardJBossXml == false)
+                  throw new DeploymentException("standardjboss.xml not specified and "+ServerConfig.SERVER_CONFIG_URL+" does not exist");
+               URL configUrl = new URL(configPath);
+               standardJBossXmlPath = new URL(configUrl, "standardjboss.xml");
             }
+
+            VirtualFile stdJBoss = VFS.getRoot(standardJBossXmlPath);
+            if (stdJBoss == null && ignoreMissingStandardJBossXml == false)
+            {
+               throw new DeploymentException("standardjboss.xml not found in config dir: " + standardJBossXmlPath);
+            }
             standardMetaData = super.parse(null, stdJBoss, null);
          }
          catch (Exception ex)




More information about the jboss-cvs-commits mailing list