[jboss-cvs] JBossAS SVN: r93284 - in trunk/tomcat/src: resources and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 8 12:28:52 EDT 2009


Author: remy.maucherat at jboss.com
Date: 2009-09-08 12:28:52 -0400 (Tue, 08 Sep 2009)
New Revision: 93284

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java
   trunk/tomcat/src/resources/war-deployers-jboss-beans.xml
Log:
- Cleanup the tldJars.
- Take over the other features from Catalina, that will be processed in AS soon.

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java	2009-09-08 16:28:40 UTC (rev 93283)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/JBossContextConfig.java	2009-09-08 16:28:52 UTC (rev 93284)
@@ -968,4 +968,19 @@
 
    }
 
+   public void applicationServletContainerInitializerConfig()
+   {
+      // FIXME: Likely invoke the SCI with what was found in the deployers
+   }
+   
+   protected void createFragmentsOrder()
+   {
+      // FIXME: Propagate the order to StandardContext, will be needed for an attribute
+   }
+
+   protected void applicationExtraDescriptorsConfig()
+   {
+      // Do nothing here
+   }
+
 }

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java	2009-09-08 16:28:40 UTC (rev 93283)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/deployers/TomcatDeployer.java	2009-09-08 16:28:52 UTC (rev 93284)
@@ -25,6 +25,7 @@
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
+import java.util.StringTokenizer;
 
 import javax.management.ObjectName;
 
@@ -163,6 +164,8 @@
 
    private String policyRegistrationName;
 
+   private String tldJars = null;
+   
    public TomcatDeployer()
    {
    }
@@ -242,6 +245,16 @@
       log.debug("Passed set of authenticators=" + prop);
    }
 
+   public String getTldJars()
+   {
+      return tldJars;
+   }
+
+   public void setTldJars(String tldJars)
+   {
+      this.tldJars = tldJars;
+   }
+
    /**
     * The most important atteribute - defines the managed domain. A catalina instance (engine) corresponds to a JMX
     * domain, that's how we know where to deploy webapps.
@@ -443,7 +456,6 @@
 
             // Parse shared web.xml
             URL webXml = deployment.getClass().getClassLoader().getResource("web.xml");
-            System.out.println("Shared web.xml is: " + webXml);
             if (webXml == null)
             {
                webXml = this.getClass().getClassLoader().getResource("web.xml");
@@ -459,33 +471,35 @@
             sharedMetaData.merge(null, confWebMD);
 
             // Parse shared JARs for TLDs
-            // TODO: Make the JAR list configurable
             sharedTldMetaData = new ArrayList<TldMetaData>();
-            List<URL> urls = new ArrayList<URL>();
-            URL jstlURL = deployment.getClass().getClassLoader().getResource("jstl.jar");
-            if (jstlURL != null)
+            if (tldJars != null)
             {
-               urls.add(jstlURL);
-            }
-            URL jsfURL = deployment.getClass().getClassLoader().getResource("jsf-libs/jsf-impl.jar");
-            if (jsfURL != null)
-            {
-               urls.add(jsfURL);
-            }
-            VirtualFileFilter tldFilter = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
-            for (URL url : urls)
-            {
-               VFS vfs = VFS.getVFS(url);
-               VirtualFile metaInf = vfs.getChild("META-INF");
-               if (metaInf != null)
+               List<URL> urls = new ArrayList<URL>();
+               StringTokenizer tokenizer = new StringTokenizer(tldJars, ",");
+               while (tokenizer.hasMoreTokens())
                {
-                  List<VirtualFile> tlds = metaInf.getChildren(tldFilter);
-                  for (VirtualFile tld : tlds)
+                  String jar = tokenizer.nextToken().trim();
+                  URL jarURL = deployment.getClass().getClassLoader().getResource(jar);
+                  if (jarURL != null)
                   {
-                     TldMetaData tldMetaData = (TldMetaData) unmarshaller.unmarshal(tld.toURL().toString(), resolver);
-                     sharedTldMetaData.add(tldMetaData);
+                     urls.add(jarURL);
                   }
                }
+               VirtualFileFilter tldFilter = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
+               for (URL url : urls)
+               {
+                  VFS vfs = VFS.getVFS(url);
+                  VirtualFile metaInf = vfs.getChild("META-INF");
+                  if (metaInf != null)
+                  {
+                     List<VirtualFile> tlds = metaInf.getChildren(tldFilter);
+                     for (VirtualFile tld : tlds)
+                     {
+                        TldMetaData tldMetaData = (TldMetaData) unmarshaller.unmarshal(tld.toURL().toString(), resolver);
+                        sharedTldMetaData.add(tldMetaData);
+                     }
+                  }
+               }
             }
          }
       }

Modified: trunk/tomcat/src/resources/war-deployers-jboss-beans.xml
===================================================================
--- trunk/tomcat/src/resources/war-deployers-jboss-beans.xml	2009-09-08 16:28:40 UTC (rev 93283)
+++ trunk/tomcat/src/resources/war-deployers-jboss-beans.xml	2009-09-08 16:28:52 UTC (rev 93284)
@@ -153,6 +153,9 @@
          </value-factory>
       </property>
       
+      <!-- JARs containing TLDs --> 
+      <property name="tldJars">jstl.jar, jsf-libs/jsf-impl.jar</property>
+      
       <!-- You can configure a set of authenticators keyed by http-auth method
       used. This will apply the same set of authenticators across all web
       applications. You can override the set of authenticators at the web




More information about the jboss-cvs-commits mailing list