geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r980667 - in /geronimo/server/trunk/plugins/jasper: geronimo-jasper-builder/src/main/java/org/apache/geronimo/jasper/deployment/ geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/ geronimo-jasper/src/main/java/org/...
Date Fri, 30 Jul 2010 07:31:13 GMT
Author: djencks
Date: Fri Jul 30 07:31:13 2010
New Revision: 980667

URL: http://svn.apache.org/viewvc?rev=980667&view=rev
Log:
GERONIMO-5487 provide the ability to manually exclude listeners

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-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java
    geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/TldRegistration.java
    geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.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=980667&r1=980666&r2=980667&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
Fri Jul 30 07:31:13 2010
@@ -90,11 +90,16 @@ public class JspModuleBuilderExtension i
 
     private final Environment defaultEnvironment;
     private final NamingBuilder namingBuilders;
+    private final Set<String> excludedListenerNames = new HashSet<String>();
 
     public JspModuleBuilderExtension(@ParamAttribute(name = "defaultEnvironment") Environment
defaultEnvironment,
+                                     @ParamAttribute(name = "excludedListenerNames") Collection<String>
excludedListenerNames,
                                      @ParamReference(name = "NamingBuilders", namingType
= NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders) {
         this.defaultEnvironment = defaultEnvironment;
         this.namingBuilders = namingBuilders;
+        if (excludedListenerNames != null) {
+            this.excludedListenerNames.addAll(excludedListenerNames);
+        }
     }
 
     public void createModule(Module module, Bundle bundle, Naming naming, ModuleIDBuilder
idBuilder) throws DeploymentException {
@@ -233,9 +238,7 @@ public class JspModuleBuilderExtension i
         tldURLs.addAll(scanModule(webModule));
 
         // 4. All TLD files in all META-INF(s)
-	/*
         tldURLs.addAll(scanGlobalTlds(webModule.getEarContext().getDeploymentBundle()));
-        */
         log.debug("getTldFiles() Exit: URL[" + tldURLs.size() + "]: " + tldURLs.toString());
         return tldURLs;
     }
@@ -319,13 +322,15 @@ public class JspModuleBuilderExtension i
             List<Listener> listeners = tl.getListener();
             for (Listener listener : listeners) {
                 String className = listener.getListenerClass();
-                try {
-                    Class clas = bundle.loadClass(className);
-                    classes.add(clas);
-                    listenerNames.add(className);
-                }
-                catch (ClassNotFoundException e) {
-                    log.warn("JspModuleBuilderExtension: Could not load listener class: "
+ className + " mentioned in TLD file at " + url.toString());
+                if (!excludedListenerNames.contains(className)) {
+                    try {
+                        Class clas = bundle.loadClass(className);
+                        classes.add(clas);
+                        listenerNames.add(className);
+                    }
+                    catch (ClassNotFoundException e) {
+                        log.warn("JspModuleBuilderExtension: Could not load listener class:
" + className + " mentioned in TLD file at " + url.toString());
+                    }
                 }
             }
 

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java?rev=980667&r1=980666&r2=980667&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java
(original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper-builder/src/test/java/org/apache/geronimo/jasper/deployment/BasicTest.java
Fri Jul 30 07:31:13 2010
@@ -31,7 +31,7 @@ import org.apache.geronimo.j2ee.deployme
 public class BasicTest extends TestCase {
     
     public void testMyFacesModuleBuilderExtension() throws Exception {
-        JspModuleBuilderExtension instance = new JspModuleBuilderExtension(null, new NamingBuilderCollection(Collections.EMPTY_SET));
+        JspModuleBuilderExtension instance = new JspModuleBuilderExtension(null, null, new
NamingBuilderCollection(Collections.EMPTY_SET));
     }
 
 }

Modified: geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/TldRegistration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/TldRegistration.java?rev=980667&r1=980666&r2=980667&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/TldRegistration.java
(original)
+++ geronimo/server/trunk/plugins/jasper/geronimo-jasper/src/main/java/org/apache/geronimo/jasper/TldRegistration.java
Fri Jul 30 07:31:13 2010
@@ -20,7 +20,9 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.zip.ZipEntry;
 
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -42,9 +44,9 @@ public class TldRegistration implements 
 
     private static final Logger LOGGER = LoggerFactory.getLogger(TldRegistration.class);
     
-    private Bundle bundle;
-    private String packageNameList;
-    
+    private final Bundle bundle;
+    private final String packageNameList;
+
     public TldRegistration(@ParamSpecial(type = SpecialAttributeType.bundle) Bundle bundle,
                            @ParamAttribute(name = "packageNameList") String packageNameList)
throws Exception {
         this.bundle = bundle;
@@ -86,12 +88,11 @@ public class TldRegistration implements 
     public void doStop() throws Exception {
     }
              
-    private class TldResourceFinderCallback implements ResourceFinderCallback, TldProvider
{
+    private static class TldResourceFinderCallback implements ResourceFinderCallback, TldProvider
{
+
+        private final List<TldProvider.TldEntry> tlds = new ArrayList<TldProvider.TldEntry>();
 
-        private List<TldProvider.TldEntry> tlds;
-        
         private TldResourceFinderCallback() {
-            tlds = new ArrayList<TldProvider.TldEntry>();
         }
         
         public Collection<TldProvider.TldEntry> getTlds() {

Modified: geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml?rev=980667&r1=980666&r2=980667&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/jasper/jasper-deployer/src/main/plan/plan.xml Fri Jul 30
07:31:13 2010
@@ -21,6 +21,7 @@
 <module xmlns="http://geronimo.apache.org/xml/ns/deployment-${geronimoSchemaVersion}">
 
     <gbean name="JspModuleBuilderExtension" class="org.apache.geronimo.jasper.deployment.JspModuleBuilderExtension">
+        <attribute name="excludedListenerNames">org.apache.myfaces.webapp.StartupServletContextListener</attribute>
         <reference name="NamingBuilders">
             <name>NamingBuilders</name>
         </reference>



Mime
View raw message