geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r995315 [1/2] - in /geronimo/server/trunk/plugins/jetty8: geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/ geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/ geronimo-jetty8/src/main/java/org/apache/geroni...
Date Thu, 09 Sep 2010 05:33:40 GMT
Author: djencks
Date: Thu Sep  9 05:33:39 2010
New Revision: 995315

URL: http://svn.apache.org/viewvc?rev=995315&view=rev
Log:
GERONIMO-5567 clean up unused classes and code

Removed:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/DefaultServletHolderWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/FilterHolderWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/GeronimoServletHolder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyFilterMapping.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyServletRegistration.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JspServletHolderWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/POJOWebServiceHolderWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/ServletHolderWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/ServletNameSource.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/InjectionServletHandler.java
Modified:
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyContainerImpl.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyManagerImpl.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/connector/JettyConnector.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/JaccSecurityHandler.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/requestlog/JettyLogManagerImpl.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/AuthConfigProviderHandlerFactory.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/JettySecurityHandlerFactory.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/ApplicationTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/GBeanInfoTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/SecurityTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java
    geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/connector/ConnectorGBeanTest.java
    geronimo/server/trunk/plugins/jetty8/jetty8-deployer/src/main/plan/plan.xml

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Thu Sep  9 05:33:39 2010
@@ -24,19 +24,14 @@ import java.io.Serializable;
 import java.net.URI;
 import java.net.URL;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
 import java.util.jar.JarFile;
 
-import javax.management.ObjectName;
 import javax.xml.bind.JAXBException;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.Deployable;
@@ -65,10 +60,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.jetty8.FilterHolderWrapper;
 import org.apache.geronimo.jetty8.Host;
-import org.apache.geronimo.jetty8.JettyFilterMapping;
-import org.apache.geronimo.jetty8.ServletHolderWrapper;
 import org.apache.geronimo.jetty8.WebAppContextManager;
 import org.apache.geronimo.jetty8.WebAppContextWrapper;
 import org.apache.geronimo.jetty8.security.AuthConfigProviderHandlerFactory;
@@ -98,7 +90,6 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.WebAppInfoBuilder;
 import org.apache.geronimo.web25.deployment.WebAppInfoFactory;
 import org.apache.geronimo.web25.deployment.security.AuthenticationWrapper;
-import org.apache.geronimo.web25.deployment.utils.WebDeploymentValidationUtils;
 import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiAuthModuleType;
 import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiConfigProviderType;
 import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthConfigType;
@@ -107,22 +98,13 @@ import org.apache.geronimo.xbeans.geroni
 import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.jetty.JettyWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.jetty.config.GerJettyDocument;
-import org.apache.openejb.jee.Dispatcher;
 import org.apache.openejb.jee.ErrorPage;
-import org.apache.openejb.jee.FilterMapping;
 import org.apache.openejb.jee.FormLoginConfig;
 import org.apache.openejb.jee.JaxbJavaee;
-import org.apache.openejb.jee.JspConfig;
-import org.apache.openejb.jee.JspPropertyGroup;
-import org.apache.openejb.jee.Listener;
 import org.apache.openejb.jee.LocaleEncodingMapping;
 import org.apache.openejb.jee.LocaleEncodingMappingList;
 import org.apache.openejb.jee.LoginConfig;
 import org.apache.openejb.jee.MimeMapping;
-import org.apache.openejb.jee.ParamValue;
-import org.apache.openejb.jee.Servlet;
-import org.apache.openejb.jee.ServletMapping;
-import org.apache.openejb.jee.Taglib;
 import org.apache.openejb.jee.WebApp;
 import org.apache.openejb.jee.WelcomeFileList;
 import org.apache.xbean.osgi.bundle.util.BundleUtils;
@@ -142,7 +124,7 @@ import static java.lang.Boolean.TRUE;
  * @version $Rev:385659 $ $Date$
  */
 
-@GBean(j2eeType=NameFactory.MODULE_BUILDER)
+@GBean(j2eeType = NameFactory.MODULE_BUILDER)
 public class JettyModuleBuilder extends AbstractWebModuleBuilder implements GBeanLifecycle {
     private static final Logger log = LoggerFactory.getLogger(JettyModuleBuilder.class);
 
@@ -170,11 +152,6 @@ public class JettyModuleBuilder extends 
 
     private final Environment defaultEnvironment;
     private final AbstractNameQuery jettyContainerObjectName;
-    private final ServletInfo jspServlet;
-//    private final Collection defaultServlets;
-//    private final Collection defaultFilters;
-//    private final Collection defaultFilterMappings;
-    private final WebAppInfo defaultWebAppInfo;
     private final WebAppInfoFactory webAppInfoFactory;
 
     private final GBeanData pojoWebServiceTemplate;
@@ -187,48 +164,36 @@ public class JettyModuleBuilder extends 
     private final Map<String, String> defaultMimeTypeMappings;
 
     private static final String JETTY_NAMESPACE = JettyWebAppDocument.type.getDocumentElementName().getNamespaceURI();
-    private final String defaultJspServletName;
 
     public JettyModuleBuilder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
                               @ParamAttribute(name = "defaultSessionTimeoutSeconds") Integer defaultSessionTimeoutSeconds,
                               @ParamAttribute(name = "defaultWelcomeFiles") List<String> defaultWelcomeFiles,
                               @ParamAttribute(name = "jettyContainerObjectName") AbstractNameQuery jettyContainerName,
-//                              @ParamReference(name="JspServlet", namingType=NameFactory.SERVLET_TEMPLATE)JspServletHolderWrapper jspServlet,
-@ParamAttribute(name = "defaultWebApp") WebAppInfo defaultWebApp,
-@ParamAttribute(name = "jspServlet") WebAppInfo jspServlet,
-
-//                              @ParamReference(name="DefaultServlets", namingType=NameFactory.SERVLET_TEMPLATE)Collection<DefaultServletHolderWrapper> defaultServlets,
-//                              @ParamReference(name="DefaultFilters", namingType=NameFactory.SERVLET_TEMPLATE)Collection<FilterHolderWrapper> defaultFilters,
-//                              @ParamReference(name="DefaultFilterMappings", namingType=NameFactory.SERVLET_TEMPLATE)Collection<JettyFilterMapping> defaultFilterMappings,
-@ParamAttribute(name = "defaultJspServletName") String defaultJspServletName,
-@ParamAttribute(name = "defaultLocaleEncodingMappings") Map<String, String> defaultLocaleEncodingMappings,
-@ParamAttribute(name = "defaultMimeTypeMappings") Map<String, String> defaultMimeTypeMappings,
-@ParamReference(name = "PojoWebServiceTemplate", namingType = NameFactory.SERVLET_WEB_SERVICE_TEMPLATE) Object pojoWebServiceTemplate,
-@ParamReference(name = "WebServiceBuilder", namingType = NameFactory.MODULE_BUILDER) Collection<WebServiceBuilder> webServiceBuilder,
-@ParamReference(name = "ClusteringBuilders", namingType = NameFactory.MODULE_BUILDER) Collection<NamespaceDrivenBuilder> clusteringBuilders,
-@ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER) Collection<NamespaceDrivenBuilder> serviceBuilders,
-@ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders,
-@ParamReference(name = "ModuleBuilderExtensions", namingType = NameFactory.MODULE_BUILDER) Collection<ModuleBuilderExtension> moduleBuilderExtensions,
-@ParamReference(name = "ResourceEnvironmentSetter", namingType = NameFactory.MODULE_BUILDER) ResourceEnvironmentSetter resourceEnvironmentSetter,
-@ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
-@ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) throws GBeanNotFoundException, DeploymentException {
+                              @ParamAttribute(name = "defaultWebApp") WebAppInfo defaultWebApp,
+                              @ParamAttribute(name = "jspServlet") WebAppInfo jspServlet,
+                              @ParamAttribute(name = "defaultJspServletName") String defaultJspServletName,
+                              @ParamAttribute(name = "defaultLocaleEncodingMappings") Map<String, String> defaultLocaleEncodingMappings,
+                              @ParamAttribute(name = "defaultMimeTypeMappings") Map<String, String> defaultMimeTypeMappings,
+                              @ParamReference(name = "PojoWebServiceTemplate", namingType = NameFactory.SERVLET_WEB_SERVICE_TEMPLATE) Object pojoWebServiceTemplate,
+                              @ParamReference(name = "WebServiceBuilder", namingType = NameFactory.MODULE_BUILDER) Collection<WebServiceBuilder> webServiceBuilder,
+                              @ParamReference(name = "ClusteringBuilders", namingType = NameFactory.MODULE_BUILDER) Collection<NamespaceDrivenBuilder> clusteringBuilders,
+                              @ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER) Collection<NamespaceDrivenBuilder> serviceBuilders,
+                              @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER) NamingBuilder namingBuilders,
+                              @ParamReference(name = "ModuleBuilderExtensions", namingType = NameFactory.MODULE_BUILDER) Collection<ModuleBuilderExtension> moduleBuilderExtensions,
+                              @ParamReference(name = "ResourceEnvironmentSetter", namingType = NameFactory.MODULE_BUILDER) ResourceEnvironmentSetter resourceEnvironmentSetter,
+                              @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
+                              @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) throws GBeanNotFoundException, DeploymentException {
         super(kernel, serviceBuilders, namingBuilders, resourceEnvironmentSetter, webServiceBuilder, moduleBuilderExtensions, bundleContext);
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? 30 * 60 : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
-//        this.jspServlet = jspServlet;
-//        this.defaultServlets = defaultServlets;
-//        this.defaultFilters = defaultFilters;
-//        this.defaultFilterMappings = defaultFilterMappings;
-        this.defaultWebAppInfo = defaultWebApp;
+        ServletInfo jspServletInfo;
         if (jspServlet != null) {
-            this.jspServlet = jspServlet.servlets.get(0);
-            this.defaultJspServletName = defaultJspServletName;
+            jspServletInfo = jspServlet.servlets.get(0);
         } else {
-            this.jspServlet = null;
-            this.defaultJspServletName = null;
+            jspServletInfo = null;
         }
-        this.webAppInfoFactory = new StandardWebAppInfoFactory(defaultWebAppInfo, this.jspServlet);
+        this.webAppInfoFactory = new StandardWebAppInfoFactory(defaultWebApp, jspServletInfo);
 
         this.pojoWebServiceTemplate = getGBeanData(kernel, pojoWebServiceTemplate);
         this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders);//, GerClusteringDocument.type.getDocumentElementName());
@@ -552,12 +517,6 @@ public class JettyModuleBuilder extends 
 
             webModule.getSharedContext().put(WebModule.WEB_APP_INFO, webAppInfoBuilder);
 
-//            configure context parameters.
-//            configureContextParams(webApp, webModuleData);
-
-            // configure listeners.
-//            configureListeners(webApp, webModuleData);
-
             webModuleData.setAttribute(WebAppContextWrapper.GBEAN_ATTR_SESSION_TIMEOUT,
                     (webApp.getSessionConfig().size() == 1 && webApp.getSessionConfig().get(0).getSessionTimeout() != null) ?
                             webApp.getSessionConfig().get(0).getSessionTimeout().intValue() * 60 :
@@ -587,82 +546,9 @@ public class JettyModuleBuilder extends 
             // configure error pages.
             configureErrorPages(webApp, webModuleData);
 
-            // configure tag libs.
-//            if (defaultJspServletName != null) {
-//                for (ServletInfo servletInfo: webAppInfo.servlets) {
-//                    if (defaultJspServletName.equals(servletInfo.servletName)) {
-//                        configureTagLibs(module, webApp, webModuleData, servletInfo);
-//                    }
-//                }
-////                GBeanData jspServletData = configureDefaultServlet(jspServlet, earContext, moduleName, knownJspMappings);
-////                module.getSharedContext().put(DEFAULT_JSP_SERVLET_KEY, jspServletData);
-//            }
-
             // configure login configs.
             configureAuthentication(module, webApp, jettyWebApp, webModuleData);
 
-            // Make sure that servlet mappings point to available servlets and never add a duplicate pattern.
-
-//            buildServletMappings(module, webApp, servletMappings, knownServletMappings);
-
-            //be careful that the jsp servlet defaults don't override anything configured in the app.
-            //TODO reimplement this
-//            if (jspServlet != null) {
-//                GBeanData jspServletData = (GBeanData) module.getSharedContext().get(DEFAULT_JSP_SERVLET_KEY);
-//                Set<String> jspMappings = (Set<String>) jspServletData.getAttribute("servletMappings");
-//                jspMappings.removeAll(knownServletMappings);
-//                jspMappings.addAll(knownJspMappings);
-//                jspServletData.setAttribute("servletMappings", jspMappings);
-//            }
-
-            //"previous" filter mapping for linked list to keep dd's ordering.
-//            AbstractName previous = null;
-
-            //add default filters
-//            if (defaultFilters != null) {
-//                previous = addDefaultFiltersGBeans(earContext, moduleContext, moduleName, previous);
-//            }
-
-            //add default filtermappings
-//            if (defaultFilterMappings != null) {
-//                for (Iterator iterator = defaultFilterMappings.iterator(); iterator.hasNext();) {
-//                    Object defaultFilterMapping = iterator.next();
-//                    GBeanData filterMappingGBeanData = getGBeanData(kernel, defaultFilterMapping);
-//                    String filterName = (String) filterMappingGBeanData.getAttribute("filterName");
-//                    ObjectName defaultFilterMappingObjectName;
-//                    if (filterMappingGBeanData.getAttribute("urlPattern") != null) {
-//                        String urlPattern = (String) filterMappingGBeanData.getAttribute("urlPattern");
-//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, null, urlPattern, moduleName);
-//                    } else {
-//                        Set servletNames = filterMappingGBeanData.getReferencePatterns("Servlet");
-//                        if (servletNames == null || servletNames.size() != 1) {
-//                            throw new DeploymentException("Exactly one servlet name must be supplied");
-//                        }
-//                        ObjectName servletObjectName = (ObjectName) servletNames.iterator().next();
-//                        String servletName = servletObjectName.getKeyProperty("name");
-//                        defaultFilterMappingObjectName = NameFactory.getWebFilterMappingName(null, null, null, null, filterName, servletName, null, moduleName);
-//                    }
-//                    filterMappingGBeanData.setName(defaultFilterMappingObjectName);
-//                    filterMappingGBeanData.setReferencePattern("JettyFilterMappingRegistration", webModuleName);
-//                    moduleContext.addGBean(filterMappingGBeanData);
-//                }
-//            }
-
-            // add filter mapping GBeans.
-//            addFilterMappingsGBeans(earContext, moduleContext, moduleName, webApp, previous);
-
-            // add filter GBeans.
-//            addFiltersGBeans(earContext, moduleContext, moduleName, webApp);
-
-            //add default servlets
-//            if (defaultServlets != null) {
-//                addDefaultServletsGBeans(earContext, moduleContext, moduleName, knownServletMappings);
-//            }
-
-            //set up servlet gbeans.
-//            List<org.apache.openejb.jee.Servlet> servlets = webApp.getServlet();
-//            addServlets(moduleName, webModule, servlets, servletMappings, moduleContext);
-
             if (jettyWebApp.isSetSecurityRealmName()) {
                 configureSecurityRealm(earContext, webApp, jettyWebApp, bundle, webModuleData);
             }
@@ -729,175 +615,6 @@ public class JettyModuleBuilder extends 
 
     }
 
-//    private void addDefaultServletsGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, Set knownServletMappings) throws GBeanNotFoundException, GBeanAlreadyExistsException {
-//        for (Object defaultServlet : defaultServlets) {
-//            GBeanData servletGBeanData = configureDefaultServlet(defaultServlet, earContext, moduleName, knownServletMappings);
-//            moduleContext.addGBean(servletGBeanData);
-//        }
-//    }
-
-    private GBeanData configureDefaultServlet(Object defaultServlet, EARContext earContext, AbstractName moduleName, Set knownServletMappings) throws GBeanNotFoundException, GBeanAlreadyExistsException {
-        GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
-        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<String>) servletGBeanData.getAttribute("servletMappings"));
-        defaultServletMappings.removeAll(knownServletMappings);
-        servletGBeanData.setAttribute("servletMappings", defaultServletMappings);
-        return servletGBeanData;
-    }
-
-    private void addFiltersGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, WebApp webApp) throws GBeanAlreadyExistsException {
-        List<org.apache.openejb.jee.Filter> filters = webApp.getFilter();
-        for (org.apache.openejb.jee.Filter filter : filters) {
-            String filterName = filter.getFilterName().trim();
-            AbstractName filterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
-            GBeanData filterData = new GBeanData(filterAbstractName, FilterHolderWrapper.class);
-            filterData.setAttribute("filterName", filterName);
-            filterData.setAttribute("filterClass", filter.getFilterClass().trim());
-            Map<String, String> initParams = new HashMap<String, String>();
-            List<ParamValue> initParamArray = filter.getInitParam();
-            for (ParamValue paramValue : initParamArray) {
-                initParams.put(paramValue.getParamName().trim(), paramValue.getParamValue().trim());
-            }
-            filterData.setAttribute("initParams", initParams);
-            filterData.setReferencePattern("JettyServletRegistration", moduleName);
-            moduleContext.addGBean(filterData);
-        }
-    }
-
-    private void addFilterMappingsGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, WebApp webApp, AbstractName previous) throws GBeanAlreadyExistsException {
-        List<FilterMapping> filterMappingArray = webApp.getFilterMapping();
-        for (FilterMapping filterMapping : filterMappingArray) {
-            String filterName = filterMapping.getFilterName().trim();
-            GBeanData filterMappingData = new GBeanData(JettyFilterMapping.class);
-            if (previous != null) {
-                filterMappingData.addDependency(previous);
-            }
-            filterMappingData.setReferencePattern("JettyServletRegistration", moduleName);
-            AbstractName filterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
-
-            AbstractName filterMappingName = null;
-            if (!filterMapping.getUrlPattern().isEmpty()) {
-                String[] urlPatterns = filterMapping.getUrlPattern().toArray(new String[filterMapping.getUrlPattern().size()]);
-
-                filterMappingData.setAttribute("urlPatterns", urlPatterns);
-                filterMappingName = earContext.getNaming().createChildName(filterAbstractName, ObjectName.quote(Arrays.deepToString(urlPatterns)), NameFactory.URL_WEB_FILTER_MAPPING);
-            }
-            if (!filterMapping.getServletName().isEmpty()) {
-                Set<AbstractName> servletNameSet = new HashSet<AbstractName>();
-                for (String servletName: filterMapping.getServletName()) {
-                    //TODO trim
-                    AbstractName abstractServletName = earContext.getNaming().createChildName(moduleName, servletName, NameFactory.SERVLET);
-                    servletNameSet.add(abstractServletName);
-                    filterMappingData.addDependency(abstractServletName);
-                }
-
-                filterMappingData.setReferencePatterns("Servlets", servletNameSet);
-                filterMappingName = earContext.getNaming().createChildName(filterAbstractName, ObjectName.quote(Arrays.deepToString(servletNameSet.toArray())), NameFactory.SERVLET_WEB_FILTER_MAPPING);
-
-            }
-            filterMappingData.setAbstractName(filterMappingName);
-            previous = filterMappingName;
-
-            boolean request = filterMapping.getDispatcher().size() == 0;
-            boolean forward = false;
-            boolean include = false;
-            boolean error = false;
-            for (Dispatcher dispatcher : filterMapping.getDispatcher()) {
-                if (dispatcher.equals(Dispatcher.REQUEST)) {
-                    request = true;
-                } else if (dispatcher.equals(Dispatcher.FORWARD)) {
-                    forward = true;
-                } else if (dispatcher.equals(Dispatcher.INCLUDE)) {
-                    include = true;
-                } else if (dispatcher.equals(Dispatcher.ERROR)) {
-                    error = true;
-                }
-            }
-            filterMappingData.setAttribute("requestDispatch", request);
-            filterMappingData.setAttribute("forwardDispatch", forward);
-            filterMappingData.setAttribute("includeDispatch", include);
-            filterMappingData.setAttribute("errorDispatch", error);
-            filterMappingData.setReferencePattern("Filter", filterAbstractName);
-            moduleContext.addGBean(filterMappingData);
-        }
-    }
-
-//    private AbstractName addDefaultFiltersGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, AbstractName previous) throws GBeanNotFoundException, GBeanAlreadyExistsException {
-//        for (Object defaultFilter : defaultFilters) {
-//            GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter);
-//            String filterName = (String) filterGBeanData.getAttribute("filterName");
-//            AbstractName defaultFilterAbstractName = earContext.getNaming().createChildName(moduleName, filterName, NameFactory.WEB_FILTER);
-//            filterGBeanData.setAbstractName(defaultFilterAbstractName);
-//            filterGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
-//            moduleContext.addGBean(filterGBeanData);
-//            //add a mapping to /*
-//
-//            GBeanData filterMappingGBeanData = new GBeanData(JettyFilterMapping.class);
-//            if (previous != null) {
-//                filterMappingGBeanData.addDependency(previous);
-//            }
-//            filterMappingGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
-//            String urlPattern = "/*";
-//            filterMappingGBeanData.setAttribute("urlPattern", urlPattern);
-//            AbstractName filterMappingName = earContext.getNaming().createChildName(defaultFilterAbstractName, urlPattern, NameFactory.URL_WEB_FILTER_MAPPING);
-//            filterMappingGBeanData.setAbstractName(filterMappingName);
-//            previous = filterMappingName;
-//
-//
-//            filterMappingGBeanData.setAttribute("requestDispatch", TRUE);
-//            filterMappingGBeanData.setAttribute("forwardDispatch", TRUE);
-//            filterMappingGBeanData.setAttribute("includeDispatch", TRUE);
-//            filterMappingGBeanData.setAttribute("errorDispatch", FALSE);
-//            filterMappingGBeanData.setReferencePattern("Filter", defaultFilterAbstractName);
-//            moduleContext.addGBean(filterMappingGBeanData);
-//        }
-//        return previous;
-//    }
-
-    private void buildServletMappings(Module module, WebApp webApp, Map<String, Set<String>> servletMappings, Set<String> knownServletMappings) throws DeploymentException {
-        List<org.apache.openejb.jee.Servlet> servlets = webApp.getServlet();
-        Set<String> knownServlets = new HashSet<String>();
-        for (org.apache.openejb.jee.Servlet servlet : servlets) {
-            knownServlets.add(servlet.getServletName().trim());
-        }
-
-        List<ServletMapping> servletMappingArray = webApp.getServletMapping();
-        for (ServletMapping servletMapping : servletMappingArray) {
-            String servletName = servletMapping.getServletName().trim();
-            if (!knownServlets.contains(servletName)) {
-                throw new DeploymentException("Web app " + module.getName() +
-                        " contains a servlet mapping that refers to servlet '" + servletName +
-                        "' but no such servlet was found!");
-            }
-            List<String> urlPatterns = servletMapping.getUrlPattern();
-            addMappingsForServlet(servletName, urlPatterns, knownServletMappings, servletMappings);
-        }
-    }
-
-    private void addMappingsForServlet(String servletName, List<String> urlPatterns, Set<String> knownServletMappings, Map<String, Set<String>> servletMappings) throws DeploymentException {
-        for (String pattern : urlPatterns) {
-            String urlPattern = pattern.trim();
-            if (!urlPattern.startsWith("*") && !urlPattern.startsWith("/")) {
-                urlPattern = "/" + urlPattern;
-            }
-            if (!knownServletMappings.contains(urlPattern)) {
-                knownServletMappings.add(urlPattern);
-                if (!WebDeploymentValidationUtils.isValidUrlPattern(urlPattern)) {
-                    //TODO Better Exception message is required
-                    throw new DeploymentException("Invalid character CR(#xD) or LF(#xA) is found in mapping url");
-                }
-                Set<String> urlsForServlet = servletMappings.get(servletName);
-                if (urlsForServlet == null) {
-                    urlsForServlet = new HashSet<String>();
-                    servletMappings.put(servletName, urlsForServlet);
-                }
-                urlsForServlet.add(urlPattern);
-            }
-        }
-    }
-
     private void configureAuthentication(Module module, WebApp webApp, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws DeploymentException, GBeanAlreadyExistsException {
         EARContext moduleContext = module.getEarContext();
         List<LoginConfig> loginConfigs = webApp.getLoginConfig();
@@ -913,14 +630,14 @@ public class JettyModuleBuilder extends 
             if (authType != null) {
                 GBeanData securityFactoryData = new GBeanData(factoryName, AuthConfigProviderHandlerFactory.class);
                 securityFactoryData.setAttribute("messageLayer", MESSAGE_LAYER);
-                String contextPath = (String)webModuleData.getAttribute("contextPath");
+                String contextPath = (String) webModuleData.getAttribute("contextPath");
                 securityFactoryData.setAttribute("appContext", "server " + contextPath);
                 configureConfigurationFactory(jettyWebApp, null, securityFactoryData);
                 moduleContext.addGBean(securityFactoryData);
                 configureLocalJaspicProvider(new JettyAuthenticationWrapper(authType), contextPath, module, securityFactoryData);
                 //otherwise rely on pre-configured jaspi
             } else {
-                LoginConfig loginConfig = loginConfigs.size() == 1? loginConfigs.get(0): null;
+                LoginConfig loginConfig = loginConfigs.size() == 1 ? loginConfigs.get(0) : null;
                 GBeanData securityFactoryData = new GBeanData(factoryName, JettySecurityHandlerFactory.class);
                 configureConfigurationFactory(jettyWebApp, loginConfig, securityFactoryData);
                 BuiltInAuthMethod auth = BuiltInAuthMethod.NONE;
@@ -1010,24 +727,6 @@ public class JettyModuleBuilder extends 
         securityFactoryData.setReferencePattern("ConfigurationFactory", configurationFactoryName);
     }
 
-    private void configureTagLibs(Module module, WebApp webApp, GBeanData webModuleData, ServletInfo jspServlet) throws DeploymentException {
-        List<JspConfig> jspConfigArray = webApp.getJspConfig();
-        if (jspConfigArray.size() > 1) {
-            throw new DeploymentException("Web app " + module.getName() + " cannot have more than one jsp-config element.  Currently has " + jspConfigArray.size() + " jsp-config elements.");
-        }
-        Map<String, String> tagLibMap = new HashMap<String, String>();
-        for (JspConfig aJspConfigArray : jspConfigArray) {
-            List<Taglib> tagLibArray = aJspConfigArray.getTaglib();
-            for (Taglib taglib : tagLibArray) {
-                tagLibMap.put(taglib.getTaglibUri().trim(), taglib.getTaglibLocation().trim());
-            }
-            for (JspPropertyGroup propertyGroup : aJspConfigArray.getJspPropertyGroup()) {
-                WebAppInfoBuilder.normalizeUrlPatterns(propertyGroup.getUrlPattern(), jspServlet.servletMappings);
-            }
-        }
-        webModuleData.setAttribute("tagLibMap", tagLibMap);
-    }
-
     private void configureErrorPages(WebApp webApp, GBeanData webModuleData) {
         List<ErrorPage> errorPageArray = webApp.getErrorPage();
         Map<String, String> errorPageMap = new HashMap<String, String>();
@@ -1079,24 +778,6 @@ public class JettyModuleBuilder extends 
         webModuleData.setAttribute("mimeMap", mimeMappingMap);
     }
 
-    private void configureListeners(WebApp webApp, GBeanData webModuleData) {
-        List<Listener> listenerArray = webApp.getListener();
-        Collection<String> listeners = new ArrayList<String>();
-        for (Listener listener : listenerArray) {
-            listeners.add(listener.getListenerClass().trim());
-        }
-        webModuleData.setAttribute("listenerClassNames", listeners);
-    }
-
-    private void configureContextParams(WebApp webApp, GBeanData webModuleData) {
-        List<ParamValue> contextParamArray = webApp.getContextParam();
-        Map<String, String> contextParams = new HashMap<String, String>();
-        for (ParamValue contextParam : contextParamArray) {
-            contextParams.put(contextParam.getParamName().trim(), contextParam.getParamValue().trim());
-        }
-        webModuleData.setAttribute("contextParamMap", contextParams);
-    }
-
     private void configureHosts(EARContext earContext, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws GBeanAlreadyExistsException {
         String[] hosts = jettyWebApp.getHostArray();
         for (int i = 0; i < hosts.length; i++) {
@@ -1121,149 +802,6 @@ public class JettyModuleBuilder extends 
         return JETTY_NAMESPACE;
     }
 
-    /**
-     * Adds the provided servlets, taking into account the load-on-startup ordering.
-     *
-     * @param webModuleName   an <code>ObjectName</code> value
-     * @param module          a <code>Module</code> value
-     * @param servlets    a <code>Servlet[]</code> value, contains the <code>servlet</code> entries from <code>web.xml</code>.
-     * @param servletMappings a <code>Map</code> value
-     * @param moduleContext   an <code>EARContext</code> value
-     * @throws DeploymentException if an error occurs
-     */
-    private void addServlets(AbstractName webModuleName,
-                             Module module,
-                             List<org.apache.openejb.jee.Servlet> servlets,
-                             Map<String, Set<String>> servletMappings,
-                             EARContext moduleContext) throws DeploymentException {
-
-        // this TreeSet will order the Servlets based on whether
-        // they have a load-on-startup element and what its value is
-        TreeSet<org.apache.openejb.jee.Servlet> loadOrder = new TreeSet<org.apache.openejb.jee.Servlet>(new StartupOrderComparator());
-
-        // add all of the servlets to the sorted set
-        loadOrder.addAll(servlets);
-
-        // now that they're sorted, read them in order and add them to
-        // the context.  we'll use a GBean reference to enforce the
-        // load order.  Each servlet GBean (except the first) has a
-        // reference to the previous GBean.  The kernel will ensure
-        // that each "previous" GBean is running before it starts any
-        // other GBeans that reference it.  See also
-        // o.a.g.jetty8.JettyFilterMapping which provided the example
-        // of how to do this.
-        // http://issues.apache.org/jira/browse/GERONIMO-645
-        AbstractName previousServlet = null;
-        for (org.apache.openejb.jee.Servlet servlet : loadOrder) {
-            previousServlet = addServlet(webModuleName, module, previousServlet, servlet, servletMappings, moduleContext);
-        }
-    }
-
-    /**
-     * @param webModuleName   AbstractName of the web module
-     * @param module          the web module being added
-     * @param previousServlet the servlet to start before this one in init order
-     * @param servlet     XMLObject specifying the servlet configuration
-     * @param servletMappings Map of servlet name to set of ServletMapping strings for this web app
-     * @param moduleContext   deployment context for this module
-     * @return AbstractName of servlet gbean added
-     * @throws DeploymentException if something goes wrong
-     */
-    private AbstractName addServlet(AbstractName webModuleName,
-                                    Module module,
-                                    AbstractName previousServlet,
-                                    org.apache.openejb.jee.Servlet servlet,
-                                    Map<String, Set<String>> servletMappings,
-                                    EARContext moduleContext) throws DeploymentException {
-        String servletName = servlet.getServletName().trim();
-        AbstractName servletAbstractName = moduleContext.getNaming().createChildName(webModuleName, servletName, NameFactory.SERVLET);
-        GBeanData servletData;
-        Map<String, String> initParams = new HashMap<String, String>();
-        if (servlet.getServletClass() != null) {
-            Bundle webBundle = moduleContext.getDeploymentBundle();
-            String servletClassName = servlet.getServletClass().trim();
-            Class servletClass;
-            try {
-                servletClass = webBundle.loadClass(servletClassName);
-            } catch (ClassNotFoundException e) {
-                throw new DeploymentException("Could not load servlet class " + servletClassName + " from bundle " + webBundle, e);
-            }
-            Class baseServletClass;
-            try {
-                baseServletClass = webBundle.loadClass(Servlet.class.getName());
-            } catch (ClassNotFoundException e) {
-                throw new DeploymentException("Could not load javax.servlet.Servlet in bundle " + webBundle, e);
-            }
-            if (baseServletClass.isAssignableFrom(servletClass)) {
-                servletData = new GBeanData(servletAbstractName, ServletHolderWrapper.class);
-                servletData.setAttribute("servletClass", servletClassName);
-            } else {
-                servletData = new GBeanData(pojoWebServiceTemplate);
-                servletData.setAbstractName(servletAbstractName);
-                //let the web service builder deal with configuring the gbean with the web service stack
-//                Object portInfo = portMap.get(servletName);
-//                if (portInfo == null) {
-//                    throw new DeploymentException("No web service deployment info for servlet name " + servletName); // TODO identify web app in message
-//                }
-                boolean configured = false;
-                for (Object aWebServiceBuilder : webServiceBuilder) {
-                    WebServiceBuilder serviceBuilder = (WebServiceBuilder) aWebServiceBuilder;
-                    if (serviceBuilder.configurePOJO(servletData, servletName, module, servletClassName, moduleContext)) {
-                        configured = true;
-                        break;
-                    }
-                }
-                if (!configured) {
-                    throw new DeploymentException("POJO web service: " + servletName + " not configured by any web service builder");
-                }
-            }
-        } else if (servlet.getJspFile() != null) {
-            servletData = new GBeanData(servletAbstractName, ServletHolderWrapper.class);
-            servletData.setAttribute("jspFile", servlet.getJspFile().trim());
-//            servletData.setAttribute("servletClass", jspServlet.getServletClassName());
-            initParams.put("development", "false");
-        } else {
-            throw new DeploymentException("Neither servlet class nor jsp file is set for " + servletName); // TODO identify web app in message
-        }
-
-        // link to previous servlet, if there is one, so that we
-        // preserve the <load-on-startup> ordering.
-        // http://issues.apache.org/jira/browse/GERONIMO-645
-        if (null != previousServlet) {
-            servletData.addDependency(previousServlet);
-        }
-
-        //TODO in init param setter, add classpath if jspFile is not null.
-        servletData.setReferencePattern("JettyServletRegistration", webModuleName);
-        servletData.setAttribute("servletName", servletName);
-        List<ParamValue> initParamArray = servlet.getInitParam();
-        for (ParamValue paramValue : initParamArray) {
-            initParams.put(paramValue.getParamName().trim(), paramValue.getParamValue().trim());
-        }
-        servletData.setAttribute("initParams", initParams);
-        if (servlet.getLoadOnStartup() != null) {
-            Integer loadOnStartup = servlet.getLoadOnStartup();
-            servletData.setAttribute("loadOnStartup", loadOnStartup);
-        }
-
-        Set mappings = servletMappings.get(servletName);
-        servletData.setAttribute("servletMappings", mappings == null ? Collections.EMPTY_SET : mappings);
-
-        //run-as
-        if (servlet.getRunAs() != null) {
-            String runAsRole = servlet.getRunAs().getRoleName().trim();
-            servletData.setAttribute("runAsRole", runAsRole);
-        }
-
-        try {
-            moduleContext.addGBean(servletData);
-        } catch (GBeanAlreadyExistsException e) {
-            throw new DeploymentException("Could not add servlet gbean to context", e); // TODO identify web app in message
-        }
-        return servletAbstractName;
-    }
-
-
     static class StartupOrderComparator implements Comparator<org.apache.openejb.jee.Servlet>, Serializable {
         /**
          * comparator that compares first on the basis of startup order, and then on the lexicographical

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyContainerImpl.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyContainerImpl.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyContainerImpl.java Thu Sep  9 05:33:39 2010
@@ -206,7 +206,7 @@ public class JettyContainerImpl implemen
             stats.getResponses5xxImpl().setCount((long) statsHandler.getResponses5xx());
 
             /* set elapsed time for stats collection */
-            stats.getStatsOnMsImpl().setCount((long) statsHandler.getStatsOnMs());
+            stats.getStatsOnMsImpl().setCount(statsHandler.getStatsOnMs());
         }
         return stats;
     }
@@ -288,6 +288,7 @@ public class JettyContainerImpl implemen
         try {
             server.stop();
         } catch (Exception e) {
+            //ignore
         }
     }
 
@@ -295,7 +296,7 @@ public class JettyContainerImpl implemen
         try {
             server.stop();
         } catch (Exception e) {
-            // continue
+            //ignore
         }
     }
 

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyManagerImpl.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyManagerImpl.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/JettyManagerImpl.java Thu Sep  9 05:33:39 2010
@@ -166,15 +166,14 @@ public class JettyManagerImpl implements
      * from the server environment.  It must be a connector that this container
      * is responsible for.
      *
-     * @param connectorName
+     * @param connectorName name of jetty connector to remove
      */
     public void removeConnector(AbstractName connectorName) {
         try {
             GBeanInfo info = kernel.getGBeanInfo(connectorName);
             boolean found = false;
-            Set intfs = info.getInterfaces();
-            for (Iterator it = intfs.iterator(); it.hasNext();) {
-                String intf = (String) it.next();
+            Set<String> intfs = info.getInterfaces();
+            for (String intf : intfs) {
                 if (intf.equals(JettyWebConnector.class.getName())) {
                     found = true;
                 }
@@ -211,21 +210,20 @@ public class JettyManagerImpl implements
         if (protocol == null) {
             return getConnectors();
         }
-        List result = new ArrayList();
+        List<JettyWebConnector> result = new ArrayList<JettyWebConnector>();
         ProxyManager proxyManager = kernel.getProxyManager();
         AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
-        Set names = kernel.listGBeans(query);
-        for (Iterator it = names.iterator(); it.hasNext();) {
-            AbstractName name = (AbstractName) it.next();
+        Set<AbstractName> names = kernel.listGBeans(query);
+        for (AbstractName name : names) {
             try {
                 if (kernel.getAttribute(name, "protocol").equals(protocol)) {
-                    result.add(proxyManager.createProxy(name, JettyWebConnector.class.getClassLoader()));
+                    result.add((JettyWebConnector) proxyManager.createProxy(name, JettyWebConnector.class.getClassLoader()));
                 }
             } catch (Exception e) {
                 log.error("Unable to check the protocol for a connector", e);
             }
         }
-        return (JettyWebConnector[]) result.toArray(new JettyWebConnector[names.size()]);
+        return result.toArray(new JettyWebConnector[names.size()]);
     }
 
     public WebAccessLog getAccessLog(WebContainer container) {
@@ -338,18 +336,17 @@ public class JettyManagerImpl implements
         AbstractName containerName = kernel.getAbstractNameFor(container);
         ProxyManager mgr = kernel.getProxyManager();
         try {
-            List results = new ArrayList();
+            List<JettyWebConnector> results = new ArrayList<JettyWebConnector>();
             AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
-            Set set = kernel.listGBeans(query); // all Jetty connectors
-            for (Iterator it = set.iterator(); it.hasNext();) {
-                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
+            Set<AbstractName> set = kernel.listGBeans(query); // all Jetty connectors
+            for (AbstractName name : set) {
                 GBeanData data = kernel.getGBeanData(name);
                 ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
                 if (containerName.equals(refs.getAbstractName())) {
                     try {
                         String testProtocol = (String) kernel.getAttribute(name, "protocol");
                         if (testProtocol != null && testProtocol.equals(protocol)) {
-                            results.add(mgr.createProxy(name, JettyWebConnector.class.getClassLoader()));
+                            results.add((JettyWebConnector) mgr.createProxy(name, JettyWebConnector.class.getClassLoader()));
                         }
                     } catch (Exception e) {
                         log.error("Unable to look up protocol for connector '" + name + "'", e);
@@ -357,7 +354,7 @@ public class JettyManagerImpl implements
                     break;
                 }
             }
-            return (JettyWebConnector[]) results.toArray(new JettyWebConnector[results.size()]);
+            return results.toArray(new JettyWebConnector[results.size()]);
         } catch (Exception e) {
             throw (IllegalArgumentException) new IllegalArgumentException("Unable to look up connectors for Jetty container '" + containerName + "': ").initCause(e);
         }
@@ -367,18 +364,17 @@ public class JettyManagerImpl implements
         AbstractName containerName = kernel.getAbstractNameFor(container);
         ProxyManager mgr = kernel.getProxyManager();
         try {
-            List results = new ArrayList();
+            List<JettyWebConnector> results = new ArrayList<JettyWebConnector>();
             AbstractNameQuery query = new AbstractNameQuery(JettyWebConnector.class.getName());
-            Set set = kernel.listGBeans(query); // all Jetty connectors
-            for (Iterator it = set.iterator(); it.hasNext();) {
-                AbstractName name = (AbstractName) it.next(); // a single Jetty connector
+            Set<AbstractName> set = kernel.listGBeans(query); // all Jetty connectors
+            for (AbstractName name : set) {
                 GBeanData data = kernel.getGBeanData(name);
                 ReferencePatterns refs = data.getReferencePatterns(JettyConnector.CONNECTOR_CONTAINER_REFERENCE);
                 if (containerName.equals(refs.getAbstractName())) {
-                    results.add(mgr.createProxy(name, JettyWebConnector.class.getClassLoader()));
+                    results.add((JettyWebConnector) mgr.createProxy(name, JettyWebConnector.class.getClassLoader()));
                 }
             }
-            return (JettyWebConnector[]) results.toArray(new JettyWebConnector[results.size()]);
+            return results.toArray(new JettyWebConnector[results.size()]);
         } catch (Exception e) {
             throw (IllegalArgumentException) new IllegalArgumentException("Unable to look up connectors for Jetty container '" + containerName + "'").initCause(e);
         }

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/WebAppContextWrapper.java Thu Sep  9 05:33:39 2010
@@ -71,7 +71,7 @@ import org.osgi.framework.Bundle;
 
 @GBean(name="Jetty WebApplication Context",
 j2eeType=NameFactory.WEB_MODULE)
-public class WebAppContextWrapper implements GBeanLifecycle, JettyServletRegistration, WebModule {
+public class WebAppContextWrapper implements GBeanLifecycle, WebModule {
     private static final Logger log = LoggerFactory.getLogger(WebAppContextWrapper.class);
     public static final String GBEAN_ATTR_SESSION_TIMEOUT = "sessionTimeoutSeconds";
     public static final String GBEAN_REF_SESSION_HANDLER_FACTORY = "SessionHandlerFactory";
@@ -88,12 +88,7 @@ public class WebAppContextWrapper implem
 
     private final String objectName;
     private final GeronimoWebAppContext webAppContext;
-    private final Context componentContext;
-    private final Holder holder;
 
-    private final Set<String> servletNames = new HashSet<String>();
-
-    private final IntegrationContext integrationContext;
     //hack to keep jasper happy.  This is from org.apache.tomcat.util.scan.Constants in the tomcat util jar.
     private static final String JASPER_WEB_XML_NAME = "org.apache.tomcat.util.scan.MergedWebXml";
 
@@ -148,7 +143,7 @@ public class WebAppContextWrapper implem
             throw new IllegalArgumentException("context contextPath must be non-null and start with '/', not " + contextPath);
         }
 
-        this.holder = holder == null ? Holder.EMPTY : holder;
+        holder = holder == null ? Holder.EMPTY : holder;
 
         RunAsSource runAsSource1 = runAsSource == null ? RunAsSource.NULL : runAsSource;
 
@@ -177,9 +172,9 @@ public class WebAppContextWrapper implem
 
         ServletHandler servletHandler = new ServletHandler();
 
-        this.componentContext = contextSource.getContext();
+        Context componentContext = contextSource.getContext();
         UserTransaction userTransaction = new GeronimoUserTransaction(transactionManager);
-        integrationContext = new IntegrationContext(this.componentContext, unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator, userTransaction, bundle, holder);
+        IntegrationContext integrationContext = new IntegrationContext(componentContext, unshareableResources, applicationManagedSecurityResources, trackedConnectionAssociator, userTransaction, bundle, holder);
         webAppContext = new GeronimoWebAppContext(securityHandler, sessionHandler, servletHandler, null, integrationContext, classLoader, modulePath, webAppInfo);
         webAppContext.setContextPath(contextPath);
         //See Jetty-386.  Setting this to true can expose secured content.
@@ -196,7 +191,7 @@ public class WebAppContextWrapper implem
             Map<String, Object> servletContext = new HashMap<String, Object>();
             Map<Class, Object> customizerContext = new HashMap<Class, Object>();
             customizerContext.put(Map.class, servletContext);
-            customizerContext.put(Context.class, WebAppContextWrapper.this.componentContext);
+            customizerContext.put(Context.class, componentContext);
             contextCustomizer.customize(customizerContext);
             for (Map.Entry<String, Object> entry: servletContext.entrySet()) {
                 webAppContext.setAttribute(entry.getKey(), entry.getValue());
@@ -285,31 +280,6 @@ public class WebAppContextWrapper implem
         return this.webAppContext.getContextPath();
     }
 
-    public <T>Class<? extends T> loadClass(String className, Class<T> clazz) throws ClassNotFoundException {
-        return integrationContext.getBundle().loadClass(className).asSubclass(clazz);
-    }
-
-    public IntegrationContext getIntegrationContext() {
-        return integrationContext;
-    }
-
-    public Object newInstance(String className) throws InstantiationException, IllegalAccessException {
-        if (className == null) {
-            throw new InstantiationException("no class loaded");
-        }
-        return holder.newInstance(className, webClassLoader, componentContext);
-    }
-
-    public void destroyInstance(Object o) throws Exception {
-        Class clazz = o.getClass();
-        if (holder != null) {
-            Map<String, LifecycleMethod> preDestroy = holder.getPreDestroy();
-            if (preDestroy != null) {
-                Holder.apply(o, clazz, preDestroy);
-            }
-        }
-    }
-
     public void fullyStarted() {
         webAppContext.registerServletContext();
     }
@@ -408,13 +378,8 @@ public class WebAppContextWrapper implem
     }
 
     public String[] getServlets() {
-        synchronized (servletNames) {
-            return servletNames.toArray(new String[servletNames.size()]);
-        }
-    }
-
-    public ServletHandler getServletHandler() {
-        return this.webAppContext.getServletHandler();
+        //todo see about getting the info from jetty?
+        return new String[0];
     }
 
     /**
@@ -446,40 +411,4 @@ public class WebAppContextWrapper implem
         }
     }
 
-    public void registerServletHolder(ServletHolder servletHolder, String servletName, Set<String> servletMappings, String objectName) throws Exception {
-        webAppContext.getServletHandler().addServlet(servletHolder);
-        if (servletMappings != null) {
-            for (String urlPattern : servletMappings) {
-                ServletMapping servletMapping = new ServletMapping();
-                servletMapping.setPathSpec(urlPattern);
-                servletMapping.setServletName(servletName);
-                this.webAppContext.getServletHandler().addServletMapping(servletMapping);
-            }
-        }
-        if (objectName != null) {
-            synchronized (servletNames) {
-                servletNames.add(objectName);
-            }
-        }
-    }
-
-    public void unregisterServletHolder(ServletHolder servletHolder, String servletName, Set<String> servletMappings, String objectName) throws Exception {
-        //no way to remove servlets
-//        webAppContext.getServletHandler().removeServlet(servletHolder);
-//        if (servletMappings != null) {
-//            for (Iterator iterator = servletMappings.iterator(); iterator.hasNext();) {
-//                String urlPattern = (String) iterator.next();
-//                ServletMapping servletMapping = new ServletMapping();
-//                servletMapping.setPathSpec(urlPattern);
-//                servletMapping.setServletName(servletName);
-//                webAppContext.getServletHandler().removeServletMapping(servletMapping);
-//            }
-//        }
-        if (objectName != null) {
-            synchronized (servletNames) {
-                servletNames.remove(objectName);
-            }
-        }
-    }
-
 }

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/connector/JettyConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/connector/JettyConnector.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/connector/JettyConnector.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/connector/JettyConnector.java Thu Sep  9 05:33:39 2010
@@ -148,7 +148,7 @@ public abstract class JettyConnector imp
     }
 
     public int getLingerMillis() {
-        return (int) ((AbstractConnector) listener).getSoLingerTime();
+        return ((AbstractConnector) listener).getSoLingerTime();
     }
 
     public void setLingerMillis(int millis) {
@@ -203,7 +203,7 @@ public abstract class JettyConnector imp
                 container.removeListener(listener);
                 return;
             } catch (Exception e) {
-                continue;
+                //try again
             }
         }
     }
@@ -215,7 +215,7 @@ public abstract class JettyConnector imp
                 container.removeListener(listener);
                 return;
             } catch (Exception e) {
-                continue;
+                //try again
             }
         }
     }

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/GeronimoWebAppContext.java Thu Sep  9 05:33:39 2010
@@ -259,7 +259,7 @@ public class GeronimoWebAppContext exten
         /**
          * This is copied from jetty so we can override the restriction on event listeners.
          * TODO consider talking to jetty about making this more flexible there.
-         * @param listenerClass
+         * @param listenerClass class of desired listener
          */
         @Override
         public void addListener(Class<? extends EventListener> listenerClass)

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/JaccSecurityHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/JaccSecurityHandler.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/JaccSecurityHandler.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/handler/JaccSecurityHandler.java Thu Sep  9 05:33:39 2010
@@ -62,12 +62,7 @@ public class JaccSecurityHandler extends
 
 
     public void doStop(JettyContainer jettyContainer) throws Exception {
-        try {
-            super.doStop();
-        }
-        finally {
-            //ignore
-        }
+        super.doStop();
     }
 
     /* ------------------------------------------------------------ */

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/requestlog/JettyLogManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/requestlog/JettyLogManagerImpl.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/requestlog/JettyLogManagerImpl.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/requestlog/JettyLogManagerImpl.java Thu Sep  9 05:33:39 2010
@@ -72,10 +72,10 @@ public class JettyLogManagerImpl impleme
     private final static int GROUP_RESPONSE_LENGTH = 8;
     private final static String ACCESS_LOG_DATE_FORMAT = "dd/MMM/yyyy:HH:mm:ss ZZZZ";
     private final static String LOG_FILE_NAME_FORMAT = "yyyy_MM_dd";
-    private final Collection logGbeans;   
+    private final Collection<JettyRequestLog> logGbeans;
     private final ServerInfo serverInfo;  
 
-    public JettyLogManagerImpl(ServerInfo serverInfo, Collection logGbeans) {
+    public JettyLogManagerImpl(ServerInfo serverInfo, Collection<JettyRequestLog> logGbeans) {
         this.serverInfo = serverInfo;
         this.logGbeans = logGbeans;
     }
@@ -88,14 +88,13 @@ public class JettyLogManagerImpl impleme
      *
      */
     public String[] getLogNames() {
-        List logNames = new ArrayList();
-        for (Iterator it = logGbeans.iterator(); it.hasNext();) {
-            JettyRequestLog jettyLog = (JettyRequestLog) it.next();
-            if(jettyLog.getFilename() != null) {
+        List<String> logNames = new ArrayList<String>();
+        for (JettyRequestLog jettyLog : logGbeans) {
+            if (jettyLog.getFilename() != null) {
                 logNames.add(jettyLog.getFilename());
             }
         }
-        return (String[]) logNames.toArray(new String[logNames.size()]);
+        return logNames.toArray(new String[logNames.size()]);
     }
 
     /**
@@ -107,17 +106,17 @@ public class JettyLogManagerImpl impleme
      *
      */
     public String[] getLogFileNames(String logName) {
-        List names = new ArrayList();
+        List<String> names = new ArrayList<String>();
 
         // Find all the files for this logName
         File[] logFiles = getLogFiles(logName);
 
         if (logFiles !=null) {
-            for (int i = 0; i < logFiles.length; i++) {
-                names.add(logFiles[i].getName());
+            for (File logFile : logFiles) {
+                names.add(logFile.getName());
             }
         }
-        return (String[]) names.toArray(new String[names.size()]);
+        return names.toArray(new String[names.size()]);
     }
 
     /**
@@ -173,30 +172,31 @@ public class JettyLogManagerImpl impleme
         long start = startDate == null ? 0 : startDate.getTime();
         long end = endDate == null ? 0 : endDate.getTime();
 
-        List list = new LinkedList();
+        List<LogMessage> list = new LinkedList<LogMessage>();
         boolean capped = false;
-        int lineCount = 0, fileCount = 0;
+        int lineCount = 0;
+        int fileCount;
 
         // Find all the files for this logName
-        File logFiles[] = getLogFiles(logName);
+        File[] logFiles = getLogFiles(logName);
 
         if (logFiles !=null) {
-            for (int i = 0; i < logFiles.length; i++) {
+            for (File logFile : logFiles) {
                 fileCount = 0;
                 try {
                     // Obtain the date for the current log file
-                    String fileName = logFiles[i].getName();
+                    String fileName = logFile.getName();
                     Matcher fileDate = FILENAME_DATE_PATTERN.matcher(fileName);
                     fileDate.find();
                     SimpleDateFormat simpleFileDate = new SimpleDateFormat(LOG_FILE_NAME_FORMAT);
                     long logFileTime = simpleFileDate.parse(fileDate.group(GROUP_FILENAME_FULL_DATE)).getTime();
 
                     // Check if the dates are null (ignore) or fall within the search range
-                    if (  (start==0 && end==0)
-                       || (start>0 && start<=logFileTime && end>0 && end>=logFileTime)) {
+                    if ((start == 0 && end == 0)
+                            || (start > 0 && start <= logFileTime && end > 0 && end >= logFileTime)) {
 
                         // It's in the range, so process the file
-                        RandomAccessFile raf = new RandomAccessFile(logFiles[i], "r");
+                        RandomAccessFile raf = new RandomAccessFile(logFile, "r");
                         FileChannel fc = raf.getChannel();
                         MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
                         CharBuffer cb = Charset.forName("US-ASCII").decode(bb); //todo: does Jetty use a different charset on a foreign PC?
@@ -205,48 +205,48 @@ public class JettyLogManagerImpl impleme
                         SimpleDateFormat format = (start == 0 && end == 0) ? null : new SimpleDateFormat(ACCESS_LOG_DATE_FORMAT);
                         int max = maxResults == null ? MAX_SEARCH_RESULTS : Math.min(maxResults.intValue(), MAX_SEARCH_RESULTS);
 
-                        while(lines.find()) {
+                        while (lines.find()) {
                             ++lineCount;
                             ++fileCount;
-                            if(capped) {
+                            if (capped) {
                                 continue;
                             }
                             CharSequence line = cb.subSequence(lines.start(), lines.end());
                             target.reset(line);
-                            if(target.find()) {
-                                if(host != null && !host.equals(target.group(GROUP_HOST))) {
+                            if (target.find()) {
+                                if (host != null && !host.equals(target.group(GROUP_HOST))) {
                                     continue;
                                 }
-                                if(user != null && !user.equals(target.group(GROUP_USER))) {
+                                if (user != null && !user.equals(target.group(GROUP_USER))) {
                                     continue;
                                 }
-                                if(method != null && !method.equals(target.group(GROUP_METHOD))) {
+                                if (method != null && !method.equals(target.group(GROUP_METHOD))) {
                                     continue;
                                 }
-                                if(uri != null && !target.group(GROUP_URI).startsWith(uri)) {
+                                if (uri != null && !target.group(GROUP_URI).startsWith(uri)) {
                                     continue;
                                 }
-                                if(format != null) {
+                                if (format != null) {
                                     try {
                                         long entry = format.parse(target.group(GROUP_DATE)).getTime();
-                                        if(start > entry) {
+                                        if (start > entry) {
                                             continue;
                                         }
-                                        if(end > 0 && end < entry) {
+                                        if (end > 0 && end < entry) {
                                             continue;
                                         }
                                     } catch (ParseException e) {
                                         // can't read the date, guess this record counts.
                                     }
                                 }
-                                if(skipResults != null && skipResults.intValue() > lineCount) {
+                                if (skipResults != null && skipResults > lineCount) {
                                     continue;
                                 }
-                                if(list.size() > max) {
+                                if (list.size() > max) {
                                     capped = true;
                                     continue;
                                 }
-                                list.add(new LogMessage(fileCount,line.toString()));
+                                list.add(new LogMessage(fileCount, line.toString()));
                             }
                         }
                         fc.close();
@@ -257,7 +257,7 @@ public class JettyLogManagerImpl impleme
                 }
             }
         }
-        return new SearchResults(lineCount, (LogMessage[]) list.toArray(new LogMessage[list.size()]), capped);
+        return new SearchResults(lineCount, list.toArray(new LogMessage[list.size()]), capped);
     }
 
 

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/AuthConfigProviderHandlerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/AuthConfigProviderHandlerFactory.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/AuthConfigProviderHandlerFactory.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/AuthConfigProviderHandlerFactory.java Thu Sep  9 05:33:39 2010
@@ -59,7 +59,6 @@ public class AuthConfigProviderHandlerFa
 
     private final Map authConfigProperties = new HashMap<Object, Object>();
     private final Subject serviceSubject = null;
-    private final String appContext;
     private final boolean allowLazyAuthentication;
 //    private final Authenticator authenticator;
     private final LoginService loginService;
@@ -72,7 +71,7 @@ public class AuthConfigProviderHandlerFa
                                             @ParamAttribute(name = "allowLazyAuthentication") boolean allowLazyAuthentication,
                                             @ParamReference(name = "ConfigurationFactory") ConfigurationFactory configurationFactory
     ) throws AuthException {
-        this.appContext = appContext;
+        String appContext1 = appContext;
         this.allowLazyAuthentication = allowLazyAuthentication;
         AuthConfigFactory authConfigFactory = AuthConfigFactory.getFactory();
         RegistrationListener listener = new RegistrationListener() {

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/JettySecurityHandlerFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/JettySecurityHandlerFactory.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/JettySecurityHandlerFactory.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/main/java/org/apache/geronimo/jetty8/security/JettySecurityHandlerFactory.java Thu Sep  9 05:33:39 2010
@@ -98,8 +98,6 @@ public class JettySecurityHandlerFactory
         } else if (authMethod == BuiltInAuthMethod.CLIENTCERT) {
             authenticator = new ClientCertAuthenticator();
         } else if (authMethod == BuiltInAuthMethod.FORM) {
-            boolean dispatch = true;
-//            authenticator = new FormAuthenticator(loginPage, errorPage, dispatch);
             authenticator = new FormAuthenticator(loginPage, errorPage, true);
         } else if (authMethod == BuiltInAuthMethod.NONE) {
             authenticator = new NoneAuthenticator();

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/AbstractWebModuleTest.java Thu Sep  9 05:33:39 2010
@@ -63,6 +63,7 @@ import org.apache.geronimo.system.server
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.web.info.ServletInfo;
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.eclipse.jetty.server.UserIdentity;
 import org.eclipse.jetty.server.Authentication;
@@ -85,34 +86,27 @@ public class AbstractWebModuleTest exten
     protected JettyContainerImpl container;
     private TransactionManager transactionManager;
     private ConnectionTrackingCoordinator connectionTrackingCoordinator;
-    private URL configurationBaseURL;
     protected PreHandlerFactory preHandlerFactory = null;
     protected SessionHandlerFactory sessionHandlerFactory = null;
     private Bundle bundle;
     protected String appPath;
 
-    protected void setUpStaticContentServlet(JettyServletRegistration webModule) throws Exception {
-        Map<String, String> staticContentServletInitParams = new HashMap<String, String>();
-        staticContentServletInitParams.put("acceptRanges", "true");
-        staticContentServletInitParams.put("dirAllowed", "true");
-        staticContentServletInitParams.put("putAllowed", "false");
-        staticContentServletInitParams.put("delAllowed", "false");
-        staticContentServletInitParams.put("redirectWelcome", "false");
-        staticContentServletInitParams.put("minGzipLength", "8192");
-
-        new ServletHolderWrapper("test:name=staticservlet",
-                "default",
-                "org.eclipse.jetty.servlet.DefaultServlet",
-                null,
-                staticContentServletInitParams,
-                null,
-                Collections.singleton("/"),
-                null,
-                webModule);
+    protected void setUpStaticContentServlet(WebAppInfo webAppInfo) throws Exception {
+        ServletInfo servletInfo = new ServletInfo();
+        servletInfo.servletName = "default";
+        servletInfo.servletClass = "org.eclipse.jetty.servlet.DefaultServlet";
+        servletInfo.servletMappings.add("/");
+        servletInfo.initParams.put("acceptRanges", "true");
+        servletInfo.initParams.put("dirAllowed", "true");
+        servletInfo.initParams.put("putAllowed", "false");
+        servletInfo.initParams.put("delAllowed", "false");
+        servletInfo.initParams.put("redirectWelcome", "false");
+        servletInfo.initParams.put("minGzipLength", "8192");
 
+        webAppInfo.servlets.add(servletInfo);
     }
 
-    protected WebAppContextWrapper setUpAppContext(String securityRealmName, SecurityHandlerFactory securityHandlerFactory, String policyContextId, RunAsSource runAsSource, String uriString) throws Exception {
+    protected WebAppContextWrapper setUpAppContext(String securityRealmName, SecurityHandlerFactory securityHandlerFactory, String policyContextId, RunAsSource runAsSource, String uriString, WebAppInfo webAppInfo) throws Exception {
 
         if (securityHandlerFactory == null) {
             Permissions unchecked = new Permissions();
@@ -174,7 +168,7 @@ public class AbstractWebModuleTest exten
                 securityHandlerFactory,
                 runAsSource,
                 new Holder(),
-                new WebAppInfo(),
+                webAppInfo,
                 null,
                 connectionTrackingCoordinator,
                 container,
@@ -194,12 +188,15 @@ public class AbstractWebModuleTest exten
 //        Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
         Authenticator serverAuthentication = new FormAuthenticator("/auth/logon.html?param=test", "/auth/logonError.html?param=test", true);
         SecurityHandlerFactory securityHandlerFactory = new ServerAuthenticationGBean(serverAuthentication, loginService);
+        WebAppInfo webAppInfo = new WebAppInfo();
+        setUpStaticContentServlet(webAppInfo);
         return setUpAppContext(
                 securityRealmName,
                 securityHandlerFactory,
                 policyContextId,
                 jacc,
-                "war3/");
+                "war3/",
+                webAppInfo);
 
     }
 
@@ -237,7 +234,7 @@ public class AbstractWebModuleTest exten
     protected void setUp() throws Exception {
         cl = this.getClass().getClassLoader();
 
-        configurationBaseURL = cl.getResource("deployables/");
+        URL configurationBaseURL = cl.getResource("deployables/");
 
         ServerInfo serverInfo = new BasicServerInfo(".");
         String location = configurationBaseURL.toString();

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/ApplicationTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/ApplicationTest.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/ApplicationTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/ApplicationTest.java Thu Sep  9 05:33:39 2010
@@ -27,6 +27,8 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.geronimo.web.info.ServletInfo;
+import org.apache.geronimo.web.info.WebAppInfo;
 import org.eclipse.jetty.server.session.SessionHandler;
 import org.eclipse.jetty.server.Request;
 
@@ -43,9 +45,11 @@ public class ApplicationTest extends Abs
     }
 
     public void testApplication() throws Exception {
-        WebAppContextWrapper app = setUpAppContext(null, null, "policyContextID", null, "war1/");
+        WebAppInfo webAppInfo = new WebAppInfo();
+        setUpStaticContentServlet(webAppInfo);
+
+        setUpAppContext(null, null, "policyContextID", null, "war1/", webAppInfo);
 
-        setUpStaticContentServlet(app);
 
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:5678/test/hello.txt").openConnection();
         BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
@@ -57,9 +61,10 @@ public class ApplicationTest extends Abs
     public void testApplicationWithSessionHandler() throws Exception {
         preHandlerFactory = new MockPreHandlerFactory();
         sessionHandlerFactory = new MockSessionHandlerFactory();
-        WebAppContextWrapper app = setUpAppContext(null, null, "policyContextID", null, "war1/");
+        WebAppInfo webAppInfo = new WebAppInfo();
+        setUpStaticContentServlet(webAppInfo);
 
-        setUpStaticContentServlet(app);
+        setUpAppContext(null, null, "policyContextID", null, "war1/", webAppInfo);
 
         HttpURLConnection connection = (HttpURLConnection) new URL("http://localhost:5678/test/hello.txt").openConnection();
         BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/GBeanInfoTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/GBeanInfoTest.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/GBeanInfoTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/GBeanInfoTest.java Thu Sep  9 05:33:39 2010
@@ -28,11 +28,6 @@ import org.apache.geronimo.system.server
  */
 public class GBeanInfoTest extends TestCase {
 
-    public void testJettyPOJOWebServiceHolder() throws Exception {
-        new AnnotationGBeanInfoFactory().getGBeanInfo(POJOWebServiceHolderWrapper.class);
-//        new POJOWebServiceHolderWrapper();
-    }
-
     public void testJettyContainerImpl() throws Exception {
         new AnnotationGBeanInfoFactory().getGBeanInfo(JettyContainerImpl.class);
         ServerInfo serverInfo = new BasicServerInfo(".");

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/SecurityTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/SecurityTest.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/SecurityTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/SecurityTest.java Thu Sep  9 05:33:39 2010
@@ -154,9 +154,7 @@ public class SecurityTest extends Abstra
     }
 
     protected void startWebApp(Map<String, SubjectInfo> roleDesignates, Map<Principal, Set<String>> principalRoleMap, ComponentPermissions componentPermissions, SubjectInfo defaultSubjectInfo, PermissionCollection checked, Set securityRoles) throws Exception {
-        WebAppContextWrapper app = setUpSecureAppContext(securityRealmName, roleDesignates, principalRoleMap, componentPermissions, defaultSubjectInfo, checked, securityRoles);
-        setUpStaticContentServlet(app);
-//        start(appName, app);
+        setUpSecureAppContext(securityRealmName, roleDesignates, principalRoleMap, componentPermissions, defaultSubjectInfo, checked, securityRoles);
     }
 
     protected void stopWebApp() throws Exception {

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/StatTest.java Thu Sep  9 05:33:39 2010
@@ -25,6 +25,7 @@ import javax.management.ObjectName;
 import javax.management.j2ee.statistics.Statistic;
 import javax.management.j2ee.statistics.Stats;
 import org.apache.geronimo.management.LazyStatisticsProvider;
+import org.apache.geronimo.web.info.WebAppInfo;
 
 /**
  * @version $Rev$ $Date$
@@ -84,8 +85,8 @@ public class StatTest extends AbstractWe
     protected void setUp() throws Exception {
         appPath = "war1";
         super.setUp();
-        WebAppContextWrapper app;
-        app = setUpAppContext(null, null, "policyContextID", null, "war1/");
-        setUpStaticContentServlet(app);
+        WebAppInfo webAppInfo = new WebAppInfo();
+        setUpStaticContentServlet(webAppInfo);
+        setUpAppContext(null, null, "policyContextID", null, "war1/", webAppInfo);
     }
 }

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/connector/ConnectorGBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/connector/ConnectorGBeanTest.java?rev=995315&r1=995314&r2=995315&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/connector/ConnectorGBeanTest.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/src/test/java/org/apache/geronimo/jetty8/connector/ConnectorGBeanTest.java Thu Sep  9 05:33:39 2010
@@ -29,10 +29,10 @@ import junit.framework.TestCase;
 public class ConnectorGBeanTest extends TestCase {
 
     public void testGBeans() throws Exception {
-        GBeanInfo gBeanInfo = HTTPBlockingConnector.getGBeanInfo();
-        gBeanInfo = HTTPSelectChannelConnector.getGBeanInfo();
-        gBeanInfo = HTTPSocketConnector.getGBeanInfo();
-        gBeanInfo = HTTPSSelectChannelConnector.getGBeanInfo();
-        gBeanInfo = HTTPSSocketConnector.getGBeanInfo();
+        HTTPBlockingConnector.getGBeanInfo();
+        HTTPSelectChannelConnector.getGBeanInfo();
+        HTTPSocketConnector.getGBeanInfo();
+        HTTPSSelectChannelConnector.getGBeanInfo();
+        HTTPSSocketConnector.getGBeanInfo();
     }
 }



Mime
View raw message