geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r828819 - in /geronimo/server/trunk/plugins/jasper: ./ geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/ geronimo-jasper/ geronimo-jasper/src/main/java/org/apache/geronimo/jasper/ jasper-deployer/src/main/history/...
Date Thu, 22 Oct 2009 19:11:52 GMT
Author: rickmcguire
Date: Thu Oct 22 19:11:51 2009
New Revision: 828819

URL: http://svn.apache.org/viewvc?rev=828819&view=rev
Log:
some jasper cleanup work

Modified:
    geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
    geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml
    geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java
    geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml
    geronimo/server/trunk/plugins/jasper/pom.xml

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java?rev=828819&r1=828818&r2=828819&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/JspModuleBuilderExtension.java
Thu Oct 22 19:11:51 2009
@@ -75,6 +75,8 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
+import org.osgi.framework.Bundle;
+
 /**
  * This JSP module builder extension is meant to find all the TLD descriptor files associated
with a
  * deployable artifact, search those TLD files for listeners, search those listeners for
@@ -110,10 +112,10 @@
     public void installModule(JarFile earFile, EARContext earContext, Module module, Collection
configurationStores, ConfigurationStore targetConfigurationStore, Collection repository) throws
DeploymentException {
     }
 
-    public void initContext(EARContext earContext, Module module, ClassLoader cl) throws
DeploymentException {
+    public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException
{
     }
 
-    public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection
repository) throws DeploymentException {
+    public void addGBeans(EARContext earContext, Module module, Bundle bundle, Collection
repository) throws DeploymentException {
         if (!(module instanceof WebModule)) {
             //not a web module, nothing to do
             return;
@@ -252,14 +254,16 @@
         // 4. All TLD files in all META-INF(s)
         tempURLs.clear();
         try {
-            Enumeration<URL> enumURLs = webModule.getEarContext().getClassLoader().getResources("META-INF");
-            while (enumURLs.hasMoreElements()) {
-                URL enumURL = enumURLs.nextElement();
-                tempURLs = scanDirectory(enumURL);
-                for (URL metaInfURL : tempURLs) {
-                    tldURLs.add(metaInfURL);
+            Enumeration<URL> enumURLs = webModule.getEarContext().getBundle().getResources("META-INF");
+            if (enumURLs != null) {
+                while (enumURLs.hasMoreElements()) {
+                    URL enumURL = enumURLs.nextElement();
+                    tempURLs = scanDirectory(enumURL);
+                    for (URL metaInfURL : tempURLs) {
+                        tldURLs.add(metaInfURL);
+                    }
+                    tempURLs.clear();
                 }
-                tempURLs.clear();
             }
         }
         catch (IOException ioe) {
@@ -426,11 +430,11 @@
         }
 
         // Get the classloader from the module's EARContext
-        ClassLoader classLoader = webModule.getEarContext().getClassLoader();
+        Bundle bundle = webModule.getEarContext().getBundle();
         List<Class> classes = new ArrayList<Class>();
 
         for (URL url : urls) {
-            parseTldFile(url, classLoader, classes, listenerNames);
+            parseTldFile(url, bundle, classes, listenerNames);
         }
 
         if (log.isDebugEnabled()) {
@@ -440,7 +444,7 @@
     }
 
 
-    private void parseTldFile(URL url, ClassLoader classLoader, List<Class> classes,
Set<String> listenerNames) throws DeploymentException {
+    private void parseTldFile(URL url, Bundle bundle, List<Class> classes, Set<String>
listenerNames) throws DeploymentException {
         log.debug("parseTLDFile( " + url.toString() + " ): Entry");
 
         try {
@@ -455,7 +459,7 @@
                 String className = cls.getStringValue().trim();
                 listenerNames.add(className);
                 try {
-                    Class clas = classLoader.loadClass(className);
+                    Class clas = bundle.loadClass(className);
                     classes.add(clas);
                 }
                 catch (ClassNotFoundException e) {
@@ -469,7 +473,7 @@
                 FullyQualifiedClassType cls = tag.getTagClass();
                 String className = cls.getStringValue().trim();
                 try {
-                    Class clas = classLoader.loadClass(className);
+                    Class clas = bundle.loadClass(className);
                     classes.add(clas);
                 }
                 catch (ClassNotFoundException e) {
@@ -684,7 +688,7 @@
             } catch (XmlException e) {
                 log.warn("Invalid transformed taglib", e);
             }
-            if (log.isDebugEnabled()) { 
+            if (log.isDebugEnabled()) {
                 log.debug("convertToTaglibSchema( " + result.toString() + " ): Exit 1");
             }
             return (TaglibDocument) result;
@@ -694,7 +698,7 @@
         } catch (XmlException e) {
             log.warn("Invalid transformed taglib", e);
         }
-        if (log.isDebugEnabled()) { 
+        if (log.isDebugEnabled()) {
             log.debug("convertToTaglibSchema( " + xmlObject.toString() + " ): Exit 2");
         }
         return (TaglibDocument) xmlObject;

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml?rev=828819&r1=828818&r2=828819&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml (original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper/pom.xml Thu Oct 22 19:11:51 2009
@@ -53,6 +53,18 @@
         <dependency>
             <groupId>${tomcatGroupId}</groupId>
             <artifactId>jasper-el</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.eclipse.jdt</groupId>
+                    <artifactId>core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.servicemix.bundles</groupId>
+            <artifactId>org.apache.servicemix.bundles.jdt-core</artifactId>
+            <version>3.2.3_2-SNAPSHOT</version>
         </dependency>
 
         <dependency>

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java?rev=828819&r1=828818&r2=828819&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java
(original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/GeronimoTldLocationsCache.java
Thu Oct 22 19:11:51 2009
@@ -5,9 +5,9 @@
  * The ASF licenses this file to You under the Apache License, Version 2.0
  * (the "License"); you may not use this file except in compliance with
  * the License.  You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -36,8 +36,8 @@
 
 import javax.servlet.ServletContext;
 
-import org.apache.geronimo.kernel.config.MultiParentClassLoader;
-import org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader;
+// import org.apache.geronimo.kernel.config.MultiParentClassLoader;
+// import org.apache.geronimo.kernel.config.ChildrenConfigurationClassLoader;
 import org.apache.jasper.Constants;
 import org.apache.jasper.JasperException;
 import org.apache.jasper.compiler.TldLocationsCache;
@@ -49,7 +49,7 @@
 /**
  * A container for all tag libraries that are defined "globally"
  * for the web application.
- * 
+ *
  * Tag Libraries can be defined globally in one of two ways:
  *   1. Via <taglib> elements in web.xml:
  *      the uri and location of the tag-library are specified in
@@ -74,7 +74,7 @@
  * If no mapping is found, then the uri specified
  * in the taglib directive is to be interpreted as the location for
  * the TLD of this tag library.
- * 
+ *
  * This class was copied from tomcat to allow Geronimo
  * to override Jasper's default TldLocationsCache which does not work
  * with Geronimo's MultiParentClassLoader.  Copying was necessary because
@@ -100,10 +100,10 @@
 
     // Names of JARs that are known not to contain any TLDs
     private static HashSet<String> noTldJars;
-    
+
     // Names of JARs that have already been scanned
     ArrayList<String> scannedJars;
-    
+
     /**
      * The mapping of the 'global' tag library URI to the location (resource
      * path) of the TLD associated with that tag library. The location is
@@ -147,16 +147,16 @@
         noTldJars.add("tools.jar");
         noTldJars.add("sunpkcs11.jar");
     }
-    
+
     public GeronimoTldLocationsCache(ServletContext ctxt) {
         this(ctxt, true);
     }
 
-    /** Constructor. 
+    /** Constructor.
      *
-     * @param ctxt the servlet context of the web application in which Jasper 
+     * @param ctxt the servlet context of the web application in which Jasper
      * is running
-     * @param redeployMode if true, then the compiler will allow redeploying 
+     * @param redeployMode if true, then the compiler will allow redeploying
      * a tag library from the same jar, at the expense of slowing down the
      * server a bit. Note that this may only work on JDK 1.3.1_01a and later,
      * because of JDK bug 4211817 fixed in this release.
@@ -168,14 +168,14 @@
         this.ctxt = ctxt;
         this.redeployMode = redeployMode;
         mappings = new Hashtable<String,String[]>();
-        initialized = false;        
+        initialized = false;
     }
 
     /**
      * Sets the list of JARs that are known not to contain any TLDs.
      *
-     * @param jarNames List of comma-separated names of JAR files that are 
-     * known not to contain any TLDs 
+     * @param jarNames List of comma-separated names of JAR files that are
+     * known not to contain any TLDs
      */
     public static void setNoTldJars(String jarNames) {
         if (jarNames != null) {
@@ -194,7 +194,7 @@
      * in the web application. A tag library is 'exposed' either explicitly in
      * web.xml or implicitly via the uri tag in the TLD of a taglib deployed
      * in a jar file (WEB-INF/lib).
-     * 
+     *
      * @param uri The taglib uri
      *
      * @return An array of two Strings: The first element denotes the real
@@ -224,7 +224,7 @@
 
     /*
      * Populates taglib map described in web.xml.
-     */    
+     */
     private void processWebDotXml() throws Exception {
 
         InputStream is = null;
@@ -254,7 +254,7 @@
             }
             is = uri.openStream();
             InputSource ip = new InputSource(is);
-            ip.setSystemId(uri.toExternalForm()); 
+            ip.setSystemId(uri.toExternalForm());
 
             // Parse the web application deployment descriptor
             TreeNode webtld = null;
@@ -421,7 +421,7 @@
      * Returns the value of the uri element of the given TLD, or null if the
      * given TLD does not contain any such element.
      */
-    private String getUriFromTld(String resourcePath, InputStream in) 
+    private String getUriFromTld(String resourcePath, InputStream in)
         throws JasperException
     {
         // Parse the tag library descriptor at the specified resource path
@@ -439,7 +439,7 @@
     /*
      * Scans all JARs accessible to the webapp's classloader and its
      * parent classloaders for TLDs.
-     * 
+     *
      * The list of JARs always includes the JARs under WEB-INF/lib, as well as
      * all shared JARs in the classloader delegation chain of the webapp's
      * classloader.
@@ -449,19 +449,19 @@
      * that are known not to contain any TLDs.
      */
     private void scanJars(ClassLoader loader) throws Exception {
-        
-        if (loader instanceof MultiParentClassLoader) {
-            MultiParentClassLoader mutliLoader = (MultiParentClassLoader) loader;
-            for (ClassLoader parent : mutliLoader.getParents()) {
-                scanJars(parent);
-            }
-        }
 
-        if (loader instanceof ChildrenConfigurationClassLoader) {
-            ChildrenConfigurationClassLoader childLoader = (ChildrenConfigurationClassLoader)
loader;
-            ClassLoader parent = childLoader.getParent();
-            scanJars(parent);
-        }
+//        if (loader instanceof MultiParentClassLoader) {
+//            MultiParentClassLoader mutliLoader = (MultiParentClassLoader) loader;
+//            for (ClassLoader parent : mutliLoader.getParents()) {
+//                scanJars(parent);
+//            }
+//        }
+
+//        if (loader instanceof ChildrenConfigurationClassLoader) {
+//            ChildrenConfigurationClassLoader childLoader = (ChildrenConfigurationClassLoader)
loader;
+//            ClassLoader parent = childLoader.getParent();
+//            scanJars(parent);
+//        }
 
         if (loader instanceof URLClassLoader) {
             URL[] urls = ((URLClassLoader) loader).getURLs();

Modified: geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/history/dependencies.xml?rev=828819&r1=828818&r2=828819&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/history/dependencies.xml
(original)
+++ geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/history/dependencies.xml
Thu Oct 22 19:11:51 2009
@@ -11,14 +11,29 @@
         <artifactId>j2ee-deployer</artifactId>
         <type>car</type>
     </dependency>
-    <dependency start="true">
+    <dependency>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>jasper</artifactId>
         <type>car</type>
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-j2ee-builder</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-jasper</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-jasper-builder</artifactId>
         <type>jar</type>
     </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-web-2.5-builder</artifactId>
+        <type>jar</type>
+    </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml?rev=828819&r1=828818&r2=828819&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/jasper/jasper/src/main/history/dependencies.xml Thu Oct
22 19:11:51 2009
@@ -48,17 +48,37 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.framework</groupId>
+        <artifactId>geronimo-kernel</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.framework</groupId>
         <artifactId>server-security-config</artifactId>
         <type>car</type>
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-j2ee</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-jasper</artifactId>
         <type>jar</type>
     </dependency>
     <dependency>
-        <groupId>org.eclipse.jdt</groupId>
-        <artifactId>core</artifactId>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-el_1.0_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.specs</groupId>
+        <artifactId>geronimo-jsp_2.1_spec</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.servicemix.bundles</groupId>
+        <artifactId>org.apache.servicemix.bundles.jdt-core</artifactId>
         <type>jar</type>
     </dependency>
 </plugin-artifact>

Modified: geronimo/server/trunk/plugins/jasper/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/pom.xml?rev=828819&r1=828818&r2=828819&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/pom.xml (original)
+++ geronimo/server/trunk/plugins/jasper/pom.xml Thu Oct 22 19:11:51 2009
@@ -78,6 +78,10 @@
                         <groupId>org.apache.geronimo.specs</groupId>
                         <artifactId>geronimo-servlet_2.5_spec</artifactId>
                     </exclusion>
+                    <exclusion>
+                        <groupId>org.eclipse.jdt</groupId>
+                        <artifactId>core</artifactId>
+                    </exclusion>
                 </exclusions>
             </dependency>
             <dependency>



Mime
View raw message