geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r520756 - in /geronimo/server/trunk/modules: geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/ geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/ geronimo-jetty6/src/main/java/org/apache/...
Date Wed, 21 Mar 2007 05:24:13 GMT
Author: djencks
Date: Tue Mar 20 22:24:12 2007
New Revision: 520756

URL: http://svn.apache.org/viewvc?view=rev&rev=520756
Log:
GERONIMO-2949 get the jndi handler outside the context handler: GERONIMO-3000 provide default
locale encoding mappings and mimetype mappings: this should fix 2999 for jetty, but I don't
know how to test

Modified:
    geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
    geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/GBeanInfoTest.java
    geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java

Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
Tue Mar 20 22:24:12 2007
@@ -136,6 +136,8 @@
 
     private final List<String> defaultWelcomeFiles;
     private final Integer defaultSessionTimeoutSeconds;
+    private final Map<String, String> defaultLocaleEncodingMappings;
+    private final Map<String, String> defaultMimeTypeMappings;
 
     private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI();
     private String jspServletClassName;
@@ -144,9 +146,12 @@
             Integer defaultSessionTimeoutSeconds,
             List<String> defaultWelcomeFiles,
             AbstractNameQuery jettyContainerName,
-            String jspServletClassName, Collection defaultServlets,
+            String jspServletClassName,
+            Collection defaultServlets,
             Collection defaultFilters,
             Collection defaultFilterMappings,
+            Map<String, String> defaultLocaleEncodingMappings,
+            Map<String, String> defaultMimeTypeMappings,
             Object pojoWebServiceTemplate,
             Collection<WebServiceBuilder> webServiceBuilder,
             Collection clusteringBuilders,
@@ -167,9 +172,9 @@
         this.pojoWebServiceTemplate = getGBeanData(kernel, pojoWebServiceTemplate);
         this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders,
GerClusteringDocument.type.getDocumentElementName());
 
-        //todo locale mappings
-
-        this.defaultWelcomeFiles = defaultWelcomeFiles;
+        this.defaultWelcomeFiles = defaultWelcomeFiles == null? new ArrayList<String>():
defaultWelcomeFiles;
+        this.defaultLocaleEncodingMappings = defaultLocaleEncodingMappings == null? new HashMap<String,
String>(): defaultLocaleEncodingMappings;
+        this.defaultMimeTypeMappings = defaultMimeTypeMappings == null? new HashMap<String,
String>(): defaultMimeTypeMappings;
     }
 
     private static GBeanData getGBeanData(Kernel kernel, Object template) throws GBeanNotFoundException
{
@@ -401,7 +406,7 @@
             configureWelcomeFileLists(webApp, webModuleData);
 
             // configure local encoding mapping lists.
-            configureLocalEncodingMappingLists(webApp, webModuleData);
+            configureLocaleEncodingMappingLists(webApp, webModuleData);
 
             // configure error pages.
             configureErrorPages(webApp, webModuleData);
@@ -539,7 +544,7 @@
             AbstractName defaultServletObjectName = earContext.getNaming().createChildName(moduleName,
(String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET);
             servletGBeanData.setAbstractName(defaultServletObjectName);
             servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
-            Set<String> defaultServletMappings = new HashSet<String>((Collection)
servletGBeanData.getAttribute("servletMappings"));
+            Set<String> defaultServletMappings = new HashSet<String>((Collection<String>)
servletGBeanData.getAttribute("servletMappings"));
             defaultServletMappings.removeAll(knownServletMappings);
             servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
             moduleContext.addGBean(servletGBeanData);
@@ -759,9 +764,9 @@
         webModuleData.setAttribute("errorPages", errorPageMap);
     }
 
-    private void configureLocalEncodingMappingLists(WebAppType webApp, GBeanData webModuleData)
{
+    private void configureLocaleEncodingMappingLists(WebAppType webApp, GBeanData webModuleData)
{
         LocaleEncodingMappingListType[] localeEncodingMappingListArray = webApp.getLocaleEncodingMappingListArray();
-        Map<String, String> localeEncodingMappingMap = new HashMap<String, String>();
+        Map<String, String> localeEncodingMappingMap = new HashMap<String, String>(defaultLocaleEncodingMappings);
         for (LocaleEncodingMappingListType aLocaleEncodingMappingListArray : localeEncodingMappingListArray)
{
             LocaleEncodingMappingType[] localeEncodingMappingArray = aLocaleEncodingMappingListArray.getLocaleEncodingMappingArray();
             for (LocaleEncodingMappingType localeEncodingMapping : localeEncodingMappingArray)
{
@@ -790,7 +795,7 @@
 
     private void configureMimeMappings(WebAppType webApp, GBeanData webModuleData) {
         MimeMappingType[] mimeMappingArray = webApp.getMimeMappingArray();
-        Map<String, String> mimeMappingMap = new HashMap<String, String>();
+        Map<String, String> mimeMappingMap = new HashMap<String, String>(defaultMimeTypeMappings);
         for (MimeMappingType mimeMappingType : mimeMappingArray) {
             mimeMappingMap.put(mimeMappingType.getExtension().getStringValue().trim(), mimeMappingType.getMimeType().getStringValue().trim());
         }
@@ -1009,6 +1014,8 @@
         infoBuilder.addAttribute("defaultEnvironment", Environment.class, true, true);
         infoBuilder.addAttribute("defaultSessionTimeoutSeconds", Integer.class, true, true);
         infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true, true);
+        infoBuilder.addAttribute("defaultLocaleEncodingMappings", Map.class, true, true);
+        infoBuilder.addAttribute("defaultMimeTypeMappings", Map.class, true, true);
         infoBuilder.addAttribute("jettyContainerObjectName", AbstractNameQuery.class, true,
true);
         infoBuilder.addAttribute("jspServletClassName", String.class, true, true);
         infoBuilder.addReference("DefaultServlets", JettyDefaultServletHolder.class, NameFactory.SERVLET_TEMPLATE);
@@ -1034,6 +1041,8 @@
                 "DefaultServlets",
                 "DefaultFilters",
                 "DefaultFilterMappings",
+                "defaultLocaleEncodingMappings",
+                "defaultMimeTypeMappings",
                 "PojoWebServiceTemplate",
                 "WebServiceBuilder",
                 "ClusteringBuilders",

Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
Tue Mar 20 22:24:12 2007
@@ -275,6 +275,8 @@
                 null, defaultServlets,
                 defaultFilters,
                 defaultFilterMappings,
+                null,
+                null,
                 pojoWebServiceTemplate,
                 Collections.singleton(webServiceBuilder),
                 null,

Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
Tue Mar 20 22:24:12 2007
@@ -75,6 +75,8 @@
                 null, new HashSet(),
                 new HashSet(),
                 new HashSet(),
+                null,
+                null,
                 pojoWebServiceTemplate,
                 Collections.singleton(webServiceBuilder),
                 null,

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainer.java
Tue Mar 20 22:24:12 2007
@@ -20,8 +20,7 @@
 import org.apache.geronimo.management.geronimo.WebContainer;
 import org.mortbay.jetty.Connector;
 import org.mortbay.jetty.RequestLog;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.ContextHandler;
+import org.mortbay.jetty.handler.AbstractHandlerContainer;
 
 /**
  * @version $Rev$ $Date$
@@ -31,9 +30,9 @@
 
     void removeListener(Connector listener);
 
-    void addContext(ContextHandler context);
+    void addContext(AbstractHandlerContainer context);
 
-    void removeContext(ContextHandler context);
+    void removeContext(AbstractHandlerContainer context);
 
     InternalJAASJettyRealm addRealm(String realmName);
 
@@ -49,7 +48,6 @@
 
     void setRequestLog(RequestLog log);
 
-    /* ------------------------------------------------------------ */
     RequestLog getRequestLog();
 
 }

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyContainerImpl.java
Tue Mar 20 22:24:12 2007
@@ -39,6 +39,7 @@
 import org.mortbay.jetty.handler.DefaultHandler;
 import org.mortbay.jetty.handler.HandlerCollection;
 import org.mortbay.jetty.handler.RequestLogHandler;
+import org.mortbay.jetty.handler.AbstractHandlerContainer;
 
 /**
  * @version $Rev$ $Date$
@@ -183,11 +184,11 @@
         server.removeConnector(listener);
     }
 
-    public void addContext(ContextHandler context) {
+    public void addContext(AbstractHandlerContainer context) {
         contextHandlerCollection.addHandler(context);
     }
 
-    public void removeContext(ContextHandler context) {
+    public void removeContext(AbstractHandlerContainer context) {
         contextHandlerCollection.removeHandler(context);
     }
 
@@ -265,18 +266,18 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic("Jetty Web Container",
JettyContainerImpl.class);
-        infoBuilder.addAttribute("collectStatistics", Boolean.TYPE, true);
-        infoBuilder.addAttribute("collectStatisticsStarted", Long.TYPE, false);
-        infoBuilder.addOperation("resetStatistics");
-
-        infoBuilder.addAttribute("requestLog", RequestLog.class, false, false);
-
-        infoBuilder.addOperation("addListener", new Class[]{Connector.class});
-        infoBuilder.addOperation("removeListener", new Class[]{Connector.class});
-        infoBuilder.addOperation("addContext", new Class[]{ContextHandler.class});
-        infoBuilder.addOperation("removeContext", new Class[]{ContextHandler.class});
-        infoBuilder.addOperation("addRealm", new Class[]{String.class});
-        infoBuilder.addOperation("removeRealm", new Class[]{String.class});
+//        infoBuilder.addAttribute("collectStatistics", Boolean.TYPE, true);
+//        infoBuilder.addAttribute("collectStatisticsStarted", Long.TYPE, false);
+//        infoBuilder.addOperation("resetStatistics");
+
+//        infoBuilder.addAttribute("requestLog", RequestLog.class, false, false);
+
+//        infoBuilder.addOperation("addListener", new Class[]{Connector.class});
+//        infoBuilder.addOperation("removeListener", new Class[]{Connector.class});
+//        infoBuilder.addOperation("addContext", new Class[]{ContextHandler.class});
+//        infoBuilder.addOperation("removeContext", new Class[]{ContextHandler.class});
+//        infoBuilder.addOperation("addRealm", new Class[]{String.class});
+//        infoBuilder.addOperation("removeRealm", new Class[]{String.class});
 
         infoBuilder.addAttribute("objectName", String.class, false);
         infoBuilder.addReference("WebManager", WebManager.class);

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/JettyWebAppContext.java
Tue Mar 20 22:24:12 2007
@@ -63,6 +63,7 @@
 import org.apache.geronimo.transaction.GeronimoUserTransaction;
 import org.mortbay.jetty.MimeTypes;
 import org.mortbay.jetty.handler.AbstractHandler;
+import org.mortbay.jetty.handler.AbstractHandlerContainer;
 import org.mortbay.jetty.security.Authenticator;
 import org.mortbay.jetty.servlet.ErrorPageErrorHandler;
 import org.mortbay.jetty.servlet.ServletHandler;
@@ -92,32 +93,13 @@
 
     private final String objectName;
     private final WebAppContext webAppContext;//delegate
+    private final AbstractHandlerContainer contextHandler;
     private final AbstractImmutableHandler lifecycleChain;
     private final Context componentContext;
     private final Holder holder;
 
     private final Set<String> servletNames = new HashSet<String>();
 
-    /**
-     * @deprecated never use this...
-     */
-/*
-    public JettyWebAppContext() {
-        server = null;
-        application = null;
-        originalSpecDD = null;
-        webClassLoader = null;
-        jettyContainer = null;
-        webAppRoot = null;
-        objectName = null;
-        configurationBaseURL = null;
-        webAppContext = null;
-        lifecycleChain = null;
-        componentContext = null;
-        holder = null;
-    }
-*/
-
     public JettyWebAppContext(String objectName,
             String originalSpecDD,
             Map<String, Object> componentContext,
@@ -163,7 +145,7 @@
         assert trackedConnectionAssociator != null;
         assert jettyContainer != null;
 
-        this.holder = holder == null? Holder.EMPTY: holder;
+        this.holder = holder == null ? Holder.EMPTY : holder;
 
         SessionHandler sessionHandler;
         if (null != handlerFactory) {
@@ -189,20 +171,29 @@
         ServletHandler servletHandler = new ServletHandler();
 
         webAppContext = new WebAppContext(securityHandler, sessionHandler, servletHandler,
null);
-        AbstractHandler next = sessionHandler;
-        next = new ThreadClassloaderHandler(next, classLoader);
 
+        //wrap the web app context with the jndi handler
         GeronimoUserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
         this.componentContext = EnterpriseNamingContext.createEnterpriseNamingContext(componentContext,
userTransaction, kernel, classLoader);
-        next = new ComponentContextHandler(next, this.componentContext);
-        next = new InstanceContextHandler(next, unshareableResources, applicationManagedSecurityResources,
trackedConnectionAssociator);
-        lifecycleChain = (AbstractImmutableHandler) next;
-        webAppContext.setHandler(next);
+        contextHandler = new ComponentContextHandler(webAppContext, this.componentContext);
 
+        // localize access to next
+        {
+            //install the other handlers inside the web app context
+            AbstractHandler next = sessionHandler;
+            next = new ThreadClassloaderHandler(next, classLoader);
+
+            next = new InstanceContextHandler(next, unshareableResources, applicationManagedSecurityResources,
trackedConnectionAssociator);
+            webAppContext.setHandler(next);
+
+            //install another component context handler for the lifecycle chain
+            next = new ComponentContextHandler(next, this.componentContext);
+            lifecycleChain = (AbstractImmutableHandler) next;
+        }
         MimeTypes mimeTypes = new MimeTypes();
         mimeTypes.setMimeMap(mimeMap);
         webAppContext.setMimeTypes(mimeTypes);
-        
+
         this.server = server;
         this.application = application;
         this.objectName = objectName;
@@ -375,20 +366,20 @@
 
         public void lifecycleMethod() throws Exception {
             //order seems backwards... .maybe container is calling start itself???
-            jettyContainer.addContext(webAppContext);
-            webAppContext.start();
+            jettyContainer.addContext(contextHandler);
+            contextHandler.start();
         }
     }
 
     public class StopCommand implements LifecycleCommand {
 
         public void lifecycleMethod() throws Exception {
-            webAppContext.stop();
+            contextHandler.stop();
             //TODO is this order correct?
-            for (EventListener listener: webAppContext.getEventListeners()) {
+            for (EventListener listener : webAppContext.getEventListeners()) {
                 destroyInstance(listener);
             }
-            jettyContainer.removeContext(webAppContext);
+            jettyContainer.removeContext(contextHandler);
         }
     }
     //pass through attributes.  They should be constructor params
@@ -404,7 +395,7 @@
     public void setListenerClassNames(Collection<String> eventListeners) throws ClassNotFoundException,
IllegalAccessException, InstantiationException {
         if (eventListeners != null) {
             Collection<EventListener> listeners = new ArrayList<EventListener>();
-            for (String listenerClassName: eventListeners) {
+            for (String listenerClassName : eventListeners) {
                 EventListener listener = (EventListener) newInstance(listenerClassName);
                 listeners.add(listener);
             }
@@ -475,6 +466,7 @@
      * ObjectName must match this pattern:
      * <p/>
      * domain:j2eeType=WebModule,name=MyName,J2EEServer=MyServer,J2EEApplication=MyApplication
+     *
      * @param objectName ObjectName to verify
      */
     private void verifyObjectName(ObjectName objectName) {

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/main/java/org/apache/geronimo/jetty6/handler/AbstractImmutableHandler.java
Tue Mar 20 22:24:12 2007
@@ -18,14 +18,16 @@
 
 package org.apache.geronimo.jetty6.handler;
 
-import org.mortbay.jetty.handler.AbstractHandler;
 import org.mortbay.jetty.Handler;
+import org.mortbay.jetty.HandlerContainer;
 import org.mortbay.jetty.Server;
+import org.mortbay.jetty.handler.AbstractHandler;
+import org.mortbay.jetty.handler.AbstractHandlerContainer;
 
 /**
  * @version $Rev$ $Date$
  */
-public abstract class AbstractImmutableHandler extends AbstractHandler {
+public abstract class AbstractImmutableHandler extends AbstractHandlerContainer {
     protected final AbstractHandler next;
 
     protected AbstractImmutableHandler(AbstractHandler next) {
@@ -47,11 +49,30 @@
 
     public void lifecycleCommand(LifecycleCommand lifecycleCommand) throws Exception {
         if (next instanceof AbstractImmutableHandler) {
-            ((AbstractImmutableHandler)next).lifecycleCommand(lifecycleCommand);
+            ((AbstractImmutableHandler) next).lifecycleCommand(lifecycleCommand);
         } else {
             lifecycleCommand.lifecycleMethod();
         }
     }
 
+
+    public void addHandler(Handler handler) {
+        if (next instanceof HandlerContainer) {
+            ((HandlerContainer) next).addHandler(handler);
+        } else {
+            throw new RuntimeException("geronimo HandlerContainers are immutable");
+        }
+    }
+
+    /**
+     * this is basically the implementation from HandlerWrapper.
+     * @param list partial list of handlers matching byClass (may be null)
+     * @param byClass class of the handlers we want
+     * @return extended list of handlers matching byClass
+     */
+    protected Object expandChildren(Object list, Class byClass)
+    {
+        return expandHandler(next, list, byClass);
+    }
 
 }

Modified: geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/GBeanInfoTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/GBeanInfoTest.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/GBeanInfoTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6/src/test/java/org/apache/geronimo/jetty6/GBeanInfoTest.java
Tue Mar 20 22:24:12 2007
@@ -19,6 +19,7 @@
 package org.apache.geronimo.jetty6;
 
 import junit.framework.TestCase;
+import org.apache.geronimo.gbean.GBeanInfo;
 
 /**
  * @version $Rev$ $Date$
@@ -26,10 +27,12 @@
 public class GBeanInfoTest extends TestCase {
 
     public void testJettyPOJOWebServiceHolder() throws Exception {
+        JettyPOJOWebServiceHolder.getGBeanInfo();
         new JettyPOJOWebServiceHolder();
     }
 
     public void testJettyContainerImpl() throws Exception {
+        JettyContainerImpl.getGBeanInfo();
         new JettyContainerImpl(null, null);
     }
 }

Modified: geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java?view=diff&rev=520756&r1=520755&r2=520756
==============================================================================
--- geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
(original)
+++ geronimo/server/trunk/modules/geronimo-myfaces-builder/src/main/java/org/apache/geronimo/myfaces/deployment/MyFacesModuleBuilderExtension.java
Tue Mar 20 22:24:12 2007
@@ -63,6 +63,7 @@
 import org.apache.geronimo.xbeans.javaee.ParamValueType;
 import org.apache.geronimo.xbeans.javaee.ServletType;
 import org.apache.geronimo.xbeans.javaee.WebAppType;
+import org.apache.geronimo.xbeans.javaee.ListenerType;
 import org.apache.myfaces.webapp.StartupServletContextListener;
 import org.apache.xbean.finder.ClassFinder;
 import org.apache.xmlbeans.XmlCursor;
@@ -130,6 +131,11 @@
         Object value = webAppData.getAttribute("listenerClassNames");
         if (value instanceof Collection && !((Collection) value).contains(CONTEXT_LISTENER_NAME))
{
             ((Collection<String>) value).add(CONTEXT_LISTENER_NAME);
+        } else {
+            //try to add listener to the web app xml
+            ListenerType listenerType = webApp.addNewListener();
+            FullyQualifiedClassType className = listenerType.addNewListenerClass();
+            className.setStringValue(CONTEXT_LISTENER_NAME);
         }
         AbstractName moduleName = moduleContext.getModuleName();
         Map<NamingBuilder.Key, Object> buildingContext = new HashMap<NamingBuilder.Key,
Object>();



Mime
View raw message