[grizzly~git:d663f8a3] [2.3.x] Initial changes for https://java.net/jira/browse/GRIZZLY-1497 (Su

  • From: rlubke@...
  • To: commits@...
  • Subject: [grizzly~git:d663f8a3] [2.3.x] Initial changes for https://java.net/jira/browse/GRIZZLY-1497 (Su
  • Date: Fri, 17 May 2013 19:39:28 +0000

Project:    grizzly
Repository: git
Revision:   d663f8a372e64dad7c8b17ead350a95a21c5c443
Author:     rlubke
Date:       2013-05-17 19:36:34 UTC
Link:       

Log Message:
------------
[2.3.x] Cleanup before work begins.

[2.3.x] Initial changes for https://java.net/jira/browse/GRIZZLY-1497 ;
(Support for filters in the OSGi HTTP Service).



Revisions:
----------
c33a877764f2bb274921461a7092600bba328d1d
d663f8a372e64dad7c8b17ead350a95a21c5c443


Modified Paths:
---------------
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/Activator.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceFactory.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceImpl.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiCleanMapper.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiMainHandler.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiResourceHandler.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiServletContext.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiServletHandler.java
extras/grizzly-httpservice/src/test/java/org/glassfish/grizzly/osgi/httpservice/OSGiCleanMapperTest.java
modules/http-servlet/src/main/java/org/glassfish/grizzly/servlet/ServletHandler.java
modules/http-servlet/src/main/java/org/glassfish/grizzly/servlet/WebappContext.java


Added Paths:
------------
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceExtension.java
extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiFilterConfig.java


Diffs:
------
--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/Activator.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/Activator.java
@@ -117,9 +117,8 @@ public class Activator implements BundleActivator {
                     //noinspection unchecked,RedundantCast
                     return (T) (Integer) Integer.parseInt(value);
                 } catch (NumberFormatException e) {
-                    logger.info(new StringBuilder().append("Couldn't parse 
'").append(name)
-                            .append("' property, going to use default 
(").append(defValue).append("). ")
-                            .append(e.getMessage()).toString());
+                    logger.info("Couldn't parse '" + name + "' property, 
going to use default (" + defValue + "). " + e
+                                    .getMessage());
                 }
             } else if (defValue instanceof Boolean) {
                 //noinspection unchecked,RedundantCast
@@ -132,12 +131,12 @@ public class Activator implements BundleActivator {
     }
 
     /**
-     * Starts {@link GrizzlyWebServer}.
+     * Starts the {@link HttpServer}.
      *
      * @param port Port to listen on.
      * @param cometEnabled If comet should be enabled.
      * @param cometEnabled If websockets should be enabled.
-     * @throws IOException Couldn't start {@link GrizzlyWebServer}.
+     * @throws IOException Couldn't start the {@link HttpServer}.
      */
     private void startGrizzly(int port, boolean cometEnabled,
             boolean websocketsEnabled) throws IOException {--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceFactory.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceFactory.java
@@ -66,9 +66,7 @@ public class HttpServiceFactory implements ServiceFactory {
     @Override
     public HttpService getService(
             Bundle bundle, ServiceRegistration serviceRegistration) {
-        logger.info(new StringBuilder().append("Bundle: ").append(bundle)
-                .append(", is getting HttpService with serviceRegistration: 
")
-                    .append(serviceRegistration).toString());
+        logger.info("Bundle: " + bundle + ", is getting HttpService with 
serviceRegistration: " + serviceRegistration);
         return new HttpServiceImpl(bundle, logger);
     }
 
@@ -76,10 +74,7 @@ public class HttpServiceFactory implements ServiceFactory {
     public void ungetService(
             Bundle bundle, ServiceRegistration serviceRegistration,
             Object httpServiceObj) {
-        logger.info(
-                new StringBuilder().append("Bundle: ").append(bundle)
-                        .append(", is ungetting HttpService with 
serviceRegistration: ")
-                        .append(serviceRegistration).toString());
+        logger.info("Bundle: " + bundle + ", is ungetting HttpService with 
serviceRegistration: " + serviceRegistration);
         mainHttpHandler.uregisterAllLocal();
     }
 --- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceImpl.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceImpl.java
@@ -91,8 +91,7 @@ public class HttpServiceImpl implements HttpService {
             throws ServletException, NamespaceException {
 
         logger.info(
-                new StringBuilder(128).append("Registering servlet: 
").append(servlet).append(", under: ").append(alias)
-                        .append(", with: ").append(initparams).append(" and 
context: ").append(httpContext).toString());
+                "Registering servlet: " + servlet + ", under: " + alias + ", 
with: " + initparams + " and context: " + httpContext);
 
         mainHttpHandler.registerServletHandler(alias, servlet, initparams, 
httpContext, this);
     }
@@ -105,8 +104,7 @@ public class HttpServiceImpl implements HttpService {
             throws NamespaceException {
 
         logger.info(
-                new StringBuilder(128).append("Registering resource: alias: 
").append(alias).append(", prefix: ")
-                        .append(prefix).append(" and context: 
").append(httpContext).toString());
+                "Registering resource: alias: " + alias + ", prefix: " + 
prefix + " and context: " + httpContext);
 
         mainHttpHandler.registerResourceHandler(alias, httpContext, prefix, 
this);
     }
@@ -116,7 +114,7 @@ public class HttpServiceImpl implements HttpService {
      */
     @Override
     public void unregister(final String alias) {
-        logger.info(new StringBuilder(32).append("Unregistering alias: 
").append(alias).toString());
+        logger.info("Unregistering alias: " + alias);
         mainHttpHandler.unregisterAlias(alias);
     }
 --- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiCleanMapper.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiCleanMapper.java
@@ -129,7 +129,7 @@ class OSGiCleanMapper {
      * @param servlet Servlet instance to check.
      * @return <code>true</code> if alias has been registered, else 
<code>false</code>.
      */
-    public static boolean contaisServlet(Servlet servlet) {
+    public static boolean containsServlet(Servlet servlet) {
         return registeredServlets.contains(servlet);
     }
 
@@ -168,8 +168,6 @@ class OSGiCleanMapper {
 
             // local cleanup
             localAliases.remove(alias);
-        } else {
-            // already gone
         }
     }
 
@@ -181,10 +179,7 @@ class OSGiCleanMapper {
      * @param handler HttpHandler handling requests for <code>alias</code>.
      */
     public void addHttpHandler(String alias, HttpHandler handler) {
-        if (containsAlias(alias)) {
-            // should not happend, alias should be checked before.
-            // TODO: signal it some how
-        } else {
+        if (!containsAlias(alias)) {
             registerAliasHandler(alias, handler);
             if (handler instanceof OSGiServletHandler) {
                 registeredServlets.add(((OSGiServletHandler) 
handler).getServletInstance());
@@ -267,8 +262,6 @@ class OSGiCleanMapper {
         boolean wasNew = aliasTree.add(alias);
         if (wasNew) {
             registrations.put(alias, httpHandler);
-        } else {
-            // TODO already registered, wtf
         }
         return wasNew;
     }--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiMainHandler.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiMainHandler.java
@@ -242,12 +242,9 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
                 mapper.doUnregister(alias, true);
             } else {
                 logger.warn(
-                        new StringBuilder(128).append("Bundle: 
").append(bundle)
-                                .append(" tried to unregister not owned 
alias '").append(alias)
-                                .append('\'').toString());
+                        "Bundle: " + bundle + " tried to unregister not 
owned alias '" + alias + '\'');
                 throw new IllegalArgumentException(
-                        new StringBuilder(64).append("Alias '").append(alias)
-                                .append("' was not registered by 
you.").toString());
+                        "Alias '" + alias + "' was not registered by you.");
             }
         } finally {
             lock.unlock();
@@ -264,7 +261,7 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
         lock.lock();
         try {
             for (String alias : mapper.getLocalAliases()) {
-                logger.debug(new StringBuilder().append("Unregistering 
'").append(alias).append("'").toString());
+                logger.debug("Unregistering '" + alias + "'");
                 // remember not to call Servlet.destroy() owning bundle 
might be stopped already.
                 mapper.doUnregister(alias, false);
             }
@@ -286,7 +283,7 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
             Set<String> aliases = OSGiCleanMapper.getAllAliases();
             while (!aliases.isEmpty()) {
                 String alias = ((TreeSet<String>) aliases).first();
-                logger.debug(new StringBuilder().append("Unregistering 
'").append(alias).append("'").toString());
+                logger.debug("Unregistering '" + alias + "'");
                 // remember not to call Servlet.destroy() owning bundle 
might be stopped already.
                 mapper.doUnregister(alias, false);
             }
@@ -318,15 +315,15 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
     private void validateAlias4RegOk(String alias) throws NamespaceException 
{
         if (!alias.startsWith("/")) {
             // have to start with "/"
-            String msg = new StringBuilder(64).append("Invalid alias 
'").append(alias)
-                    .append("', have to start with '/'.").toString();
+            String msg =
+                    "Invalid alias '" + alias + "', have to start with '/'.";
             logger.warn(msg);
             throw new NamespaceException(msg);
         }
         if (alias.length() > 1 && alias.endsWith("/")) {
             // if longer than "/", should not end with "/"
-            String msg = new StringBuilder(64).append("Alias 
'").append(alias)
-                    .append("' can't and with '/' with exception to alias 
'/'.").toString();
+            String msg =
+                    "Alias '" + alias + "' can't and with '/' with exception 
to alias '/'.";
             logger.warn(msg);
             throw new NamespaceException(msg);
         }
@@ -340,16 +337,15 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
     /**
      * Check if <code>servlet</code> has been already registered.
      * <p/>
-     * An instance of {@link Servlet} can be registed only once, so in case 
of servlet been registered before will throw
-     * {@link ServletException} as specified in OSGI HttpService Spec.
+     * An instance of {@link Servlet} can be registered only once, so in 
case of servlet been registered before will throw
+     * {@link ServletException} as specified in OSGi HttpService Spec.
      *
      * @param servlet {@link Servlet} to check if can be registered.
      * @throws ServletException Iff <code>servlet</code> has been registered 
before.
      */
     private void validateServlet4RegOk(Servlet servlet) throws 
ServletException {
-        if (OSGiCleanMapper.contaisServlet(servlet)) {
-            String msg = new StringBuilder(64).append("Servlet: 
'").append(servlet).append("', already registered.")
-                    .toString();
+        if (OSGiCleanMapper.containsServlet(servlet)) {
+            String msg = "Servlet: '" + servlet + "', already registered.";
             logger.warn(msg);
             throw new ServletException(msg);
         }--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiResourceHandler.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiResourceHandler.java
@@ -94,7 +94,7 @@ public class OSGiResourceHandler extends HttpHandler 
implements OSGiHandler {
     @Override
     public void service(Request request, Response response) throws Exception 
{
         String requestURI = request.getDecodedRequestURI();
-        logger.debug(new StringBuilder(128).append("OSGiResourceHandler 
requestURI: ").append(requestURI).toString());
+        logger.debug("OSGiResourceHandler requestURI: " + requestURI);
         String path = requestURI.replaceFirst(alias, prefix);
         try {
             // authentication
@@ -109,8 +109,7 @@ public class OSGiResourceHandler extends HttpHandler 
implements OSGiHandler {
         // find resource
         URL resource = httpContext.getResource(path);
         if (resource == null) {
-            logger.debug(new StringBuilder(128).append("OSGiResourceHandler 
\'").append(alias).append("\' Haven't found '").append(path)
-                    .append("'.").toString());
+            logger.debug("OSGiResourceHandler \'" + alias + "\' Haven't 
found '" + path + "'.");
             response.setStatus(404);
             return;
         } else {

--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/Activator.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/Activator.java
@@ -64,7 +64,8 @@ import org.glassfish.grizzly.websockets.WebSocketAddOn;
 public class Activator implements BundleActivator {
 
     private ServiceTracker logTracker;
-    private ServiceRegistration registration;
+    private ServiceRegistration httpServiceRegistration;
+    private ServiceRegistration extServiceRegistration;
     private Logger logger;
     private HttpServer httpServer;
     private static final String ORG_OSGI_SERVICE_HTTP_PORT = 
"org.osgi.service.http.port";
@@ -94,9 +95,17 @@ public class Activator implements BundleActivator {
         
         startGrizzly(port, cometEnabled, websocketsEnabled);
         serviceFactory = new HttpServiceFactory(httpServer, logger, 
bundleContext.getBundle());
-        registration = bundleContext.registerService(
+
+        // register our HttpService/HttpServiceExtension implementation so 
that
+        // it may be looked up by the OSGi runtime.  We do it once per 
interface
+        // type so it can be looked up by either.
+        httpServiceRegistration = bundleContext.registerService(
                 HttpService.class.getName(), serviceFactory,
                 new Properties());
+        extServiceRegistration =
+                
bundleContext.registerService(HttpServiceExtension.class.getName(),
+                                              serviceFactory,
+                                              new Properties());
     }
 
     /**
@@ -166,8 +175,11 @@ public class Activator implements BundleActivator {
     public void stop(final BundleContext bundleContext) throws Exception {
         logger.info("Stopping Grizzly OSGi HttpService");
         serviceFactory.stop();
-        if (registration != null) {
-            registration.unregister();
+        if (httpServiceRegistration != null) {
+            httpServiceRegistration.unregister();
+        }
+        if (extServiceRegistration != null) {
+            extServiceRegistration.unregister();
         }
         httpServer.stop();
         logTracker.close();--- /dev/null
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceExtension.java
@@ -0,0 +1,102 @@
+package org.glassfish.grizzly.osgi.httpservice;/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License").  You
+ * may not use this file except in compliance with the License.  You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt.  See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the 
License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or 
GPL
+ * Version 2] license."  If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above.  However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+import org.osgi.service.http.HttpContext;
+import org.osgi.service.http.HttpService;
+
+import javax.servlet.Filter;
+import javax.servlet.ServletException;
+import java.util.Dictionary;
+
+/**
+ * An extension to the OSGi {@link HttpService} interface allowing the
+ * registration/unregistration of Servlet {@link Filter} instances.
+ *
+ * @since 2.3.3
+ */
+public interface HttpServiceExtension extends HttpService {
+
+
+    /**
+     * Registers a {@link Filter} and with the {@link HttpService}.
+     *
+     * As this is an extension to the standard {@link HttpService} and there
+     * are no clear rules on how the mapping of filters should occur,
+     * this implementation follows the mapping rules as defined by the 
Servlet
+     * specification.
+     *
+     * Additionally, it should be noted that the registered {@link Filter}s 
are
+     * effectively associated with a particular {@link HttpContext}.  
Therefore,
+     * if you wish to have multiple filters associated with a particular
+     * {@link javax.servlet.Servlet}, then you should use the same {@link 
HttpContext}
+     * instance to perform the registration.
+     *
+     * {@link Filter}s will be invoked in registration order.
+     *
+     * This method will invoke {@link 
Filter#init(javax.servlet.FilterConfig)} during
+     * the registration process.
+     *
+     * When registering a {@link Filter}, take care not to reuse the same 
Filter
+     * instance across multiple registration invocations.  This could cause 
issues
+     * when removing the Filter as it may remove more url matching 
possibilities
+     * than intended.
+     *
+     * @param filter the {@link Filter} to register.
+     * @param urlPattern the url pattern that will invoke this {@link 
Filter}.
+     * @param initParams the initialization params that will be passed to the
+     *                   filter when {@link 
Filter#init(javax.servlet.FilterConfig)}
+     *                   is invoked.
+     * @param context the {@link HttpContext} associated with this {@link 
Filter}.
+     *
+     * @throws ServletException if an error occurs during {@link Filter} 
initialization.
+     */
+    public void registerFilter(final Filter filter,
+                               final String urlPattern,
+                               final Dictionary initParams,
+                               final HttpContext context) throws 
ServletException;
+
+    /**
+     * Removes the specified {@link Filter} from the service.
+     *
+     * @param filter the {@link Filter} to remove.
+     */
+    public void unregisterFilter(final Filter filter);
+
+}--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceImpl.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/HttpServiceImpl.java
@@ -46,6 +46,7 @@ import org.osgi.service.http.HttpContext;
 import org.osgi.service.http.HttpService;
 import org.osgi.service.http.NamespaceException;
 
+import javax.servlet.Filter;
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 import java.util.Dictionary;
@@ -56,24 +57,33 @@ import java.util.Dictionary;
  * @author Hubert Iwaniuk
  * @since Jan 20, 2009
  */
-public class HttpServiceImpl implements HttpService {
+public class HttpServiceImpl implements HttpServiceExtension {
+
     private final Logger logger;
     private final Bundle bundle;
+
     final OSGiMainHandler mainHttpHandler;
 
+
+    // ------------------------------------------------------------ 
Constructors
+
+
     /**
      * {@link HttpService} constructor.
      *
      * @param bundle {@link org.osgi.framework.Bundle} that got this 
instance of {@link org.osgi.service.http.HttpService}.
      * @param logger {@link 
org.glassfish.grizzly.osgi.httpservice.util.Logger} utility to be used here.
      */
-    public HttpServiceImpl(
-            Bundle bundle, final Logger logger) {
+    public HttpServiceImpl(final Bundle bundle, final Logger logger) {
         this.bundle = bundle;
         this.logger = logger;
         mainHttpHandler = new OSGiMainHandler(logger, bundle);
     }
 
+
+    // ------------------------------------------------ Methods from 
HttpService
+
+
     /**
      * {@inheritDoc}
      */
@@ -90,8 +100,9 @@ public class HttpServiceImpl implements HttpService {
             final String alias, final Servlet servlet, final Dictionary 
initparams, HttpContext httpContext)
             throws ServletException, NamespaceException {
 
-        logger.info(
-                "Registering servlet: " + servlet + ", under: " + alias + ", 
with: " + initparams + " and context: " + httpContext);
+        logger.info("Registering servlet: " + servlet + ", under: "
+                            + alias + ", with: " + initparams
+                            + " and context: " + httpContext);
 
         mainHttpHandler.registerServletHandler(alias, servlet, initparams, 
httpContext, this);
     }
@@ -103,8 +114,9 @@ public class HttpServiceImpl implements HttpService {
     public void registerResources(final String alias, String prefix, 
HttpContext httpContext)
             throws NamespaceException {
 
-        logger.info(
-                "Registering resource: alias: " + alias + ", prefix: " + 
prefix + " and context: " + httpContext);
+        logger.info("Registering resource: alias: "
+                            + alias + ", prefix: " + prefix
+                            + " and context: " + httpContext);
 
         mainHttpHandler.registerResourceHandler(alias, httpContext, prefix, 
this);
     }
@@ -118,4 +130,30 @@ public class HttpServiceImpl implements HttpService {
         mainHttpHandler.unregisterAlias(alias);
     }
 
+
+    // --------------------------------------- Methods from 
HttpServiceExtension
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void registerFilter(Filter filter, String urlPattern, Dictionary 
initParams, HttpContext context)
+    throws ServletException {
+        logger.info("Registering servlet: "
+                            + filter + ", under url-pattern: "
+                            + urlPattern + ", with: "
+                            + initParams + " and context: " + context);
+        mainHttpHandler.registerFilter(filter, urlPattern, initParams, 
context, this);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public void unregisterFilter(Filter filter) {
+        logger.info("Unregister filter: " + filter);
+        mainHttpHandler.unregisterFilter(filter);
+    }
+
 }--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiCleanMapper.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiCleanMapper.java
@@ -48,6 +48,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
+
+import org.glassfish.grizzly.osgi.httpservice.util.Logger;
 import org.osgi.service.http.HttpContext;
 
 import javax.servlet.Servlet;
@@ -70,6 +72,22 @@ class OSGiCleanMapper {
     private Set<String> localAliases = new HashSet<String>(4);
     private HashMap<HttpContext, ArrayList<OSGiServletHandler>> 
contextServletHandlerMap =
             new HashMap<HttpContext, ArrayList<OSGiServletHandler>>(3);
+    private final Logger logger;
+
+    protected Map<HttpContext, OSGiServletContext> 
httpContextToServletContextMap =
+                new HashMap<HttpContext, OSGiServletContext>();
+
+
+    // ------------------------------------------------------------ 
Constructors
+
+
+    protected OSGiCleanMapper(final Logger logger) {
+        this.logger = logger;
+    }
+
+
+    // ---------------------------------------------------------- Public 
Methods
+
 
     /**
      * Performs mapping of requested URI to registered alias if any.
@@ -256,6 +274,11 @@ class OSGiCleanMapper {
 
     public void addContext(HttpContext httpContext, 
ArrayList<OSGiServletHandler> servletHandlers) {
         contextServletHandlerMap.put(httpContext, servletHandlers);
+        httpContextToServletContextMap.put(httpContext, new 
OSGiServletContext(httpContext, logger));
+    }
+
+    public OSGiServletContext getServletContext(final HttpContext 
httpContext) {
+        return httpContextToServletContextMap.get(httpContext);
     }
 
     private static boolean registerAliasHandler(String alias, HttpHandler 
httpHandler) {--- /dev/null
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiFilterConfig.java
@@ -0,0 +1,63 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright (c) 2013 Oracle and/or its affiliates. All rights reserved.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common Development
+ * and Distribution License("CDDL") (collectively, the "License").  You
+ * may not use this file except in compliance with the License.  You can
+ * obtain a copy of the License at
+ * https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
+ * or packager/legal/LICENSE.txt.  See the License for the specific
+ * language governing permissions and limitations under the License.
+ *
+ * When distributing the software, include this License Header Notice in each
+ * file and include the License file at packager/legal/LICENSE.txt.
+ *
+ * GPL Classpath Exception:
+ * Oracle designates this particular file as subject to the "Classpath"
+ * exception as provided by Oracle in the GPL Version 2 section of the 
License
+ * file that accompanied this code.
+ *
+ * Modifications:
+ * If applicable, add the following below the License Header, with the fields
+ * enclosed by brackets [] replaced by your own identifying information:
+ * "Portions Copyright [year] [name of copyright owner]"
+ *
+ * Contributor(s):
+ * If you wish your version of this file to be governed by only the CDDL or
+ * only the GPL Version 2, indicate your decision by adding "[Contributor]
+ * elects to include this software in this distribution under the [CDDL or 
GPL
+ * Version 2] license."  If you don't indicate a single choice of license, a
+ * recipient has the option to distribute your version of this file under
+ * either the CDDL, the GPL Version 2 or to extend the choice of license to
+ * its licensees as provided above.  However, if you add GPL Version 2 code
+ * and therefore, elected the GPL Version 2 license, then the option applies
+ * only if the new code is made subject to such option by the copyright
+ * holder.
+ */
+
+package org.glassfish.grizzly.osgi.httpservice;
+
+import org.glassfish.grizzly.servlet.FilterConfigImpl;
+import org.glassfish.grizzly.servlet.WebappContext;
+
+import java.util.Map;
+
+final class OSGiFilterConfig extends FilterConfigImpl {
+
+    public OSGiFilterConfig(WebappContext servletContext) {
+        super(servletContext);
+    }
+
+    @Override
+    protected void setFilterName(String filterName) {
+        super.setFilterName(filterName);
+    }
+
+    @Override
+    protected void setInitParameters(Map<String, String> initParameters) {
+        super.setInitParameters(initParameters);
+    }
+}--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiMainHandler.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiMainHandler.java
@@ -41,11 +41,13 @@
 package org.glassfish.grizzly.osgi.httpservice;
 
 import org.glassfish.grizzly.osgi.httpservice.util.Logger;
+import org.glassfish.grizzly.servlet.FilterRegistration;
 import org.osgi.framework.Bundle;
 import org.osgi.service.http.HttpContext;
 import org.osgi.service.http.HttpService;
 import org.osgi.service.http.NamespaceException;
 
+import javax.servlet.Filter;
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 import java.util.*;
@@ -86,7 +88,7 @@ public class OSGiMainHandler extends HttpHandler implements 
OSGiHandler {
     public OSGiMainHandler(Logger logger, Bundle bundle) {
         this.logger = logger;
         this.bundle = bundle;
-        this.mapper = new OSGiCleanMapper();
+        this.mapper = new OSGiCleanMapper(logger);
     }
 
     /**
@@ -163,8 +165,11 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
      *                                        If alias was invalid or 
already registered.
      * @throws javax.servlet.ServletException If {@link 
javax.servlet.Servlet#init(javax.servlet.ServletConfig)} fails.
      */
-    public void registerServletHandler(String alias, Servlet servlet, 
Dictionary initparams, HttpContext context,
-                                       HttpService httpService)
+    public void registerServletHandler(final String alias,
+                                       final Servlet servlet,
+                                       final Dictionary initparams,
+                                       HttpContext context,
+                                       final HttpService httpService)
             throws NamespaceException, ServletException {
 
         ReentrantLock lock = OSGiCleanMapper.getLock();
@@ -192,6 +197,51 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
     }
 
     /**
+     *
+     * @param filter
+     * @param urlPattern
+     * @param initparams
+     * @param context
+     * @param httpService
+     * @throws NamespaceException
+     * @throws ServletException
+     */
+    public void registerFilter(final Filter filter,
+                               final String urlPattern,
+                               final Dictionary initparams,
+                               HttpContext context,
+                               final HttpService httpService)
+            throws ServletException {
+
+        ReentrantLock lock = OSGiCleanMapper.getLock();
+        lock.lock();
+        try {
+
+
+            if (context == null) {
+                logger.debug("No HttpContext provided, creating default");
+                context = httpService.createDefaultHttpContext();
+            }
+
+            OSGiServletContext servletContext =
+                    mapper.getServletContext(context);
+            if (servletContext == null) {
+                mapper.addContext(context, null);
+                servletContext = mapper.getServletContext(context);
+            }
+
+            FilterRegistration registration =
+                    
servletContext.addFilter(Integer.toString(filter.hashCode()), filter);
+            registration.addMappingForUrlPatterns(null, urlPattern);
+
+            filter.init(new OSGiFilterConfig(servletContext));
+
+        } finally {
+            lock.unlock();
+        }
+    }
+
+    /**
      * Registers {@link OSGiResourceHandler} in OSGi Http Service.
      * <p/>
      * Keeps truck of all registrations, takes care of thread safety.
@@ -218,8 +268,14 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
             if (internalPrefix == null) {
                 internalPrefix = "";
             }
+            OSGiServletContext servletContext = 
mapper.getServletContext(context);
 
-            mapper.addHttpHandler(alias, new OSGiResourceHandler(alias, 
internalPrefix, context, logger));
+            mapper.addHttpHandler(alias,
+                                  new OSGiResourceHandler(alias,
+                                                          internalPrefix,
+                                                          context,
+                                                          servletContext,
+                                                          logger));
         } finally {
             lock.unlock();
         }
@@ -251,6 +307,18 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
         }
     }
 
+    public void unregisterFilter(final Filter filter) {
+        ReentrantLock lock = OSGiCleanMapper.getLock();
+        lock.lock();
+        try {
+            for (OSGiServletContext servletContext : 
mapper.httpContextToServletContextMap.values()) {
+                servletContext.unregisterFilter(filter);
+            }
+        } finally {
+            lock.unlock();
+        }
+    }
+
     /**
      * Unregisters all <code>alias</code>es registered by owning bundle.
      */
@@ -264,6 +332,10 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
                 logger.debug("Unregistering '" + alias + "'");
                 // remember not to call Servlet.destroy() owning bundle 
might be stopped already.
                 mapper.doUnregister(alias, false);
+                for (OSGiServletContext servletContext : 
mapper.httpContextToServletContextMap.values()) {
+                    servletContext.unregisterAllFilters();
+                }
+                mapper.httpContextToServletContextMap.clear();
             }
         } finally {
             lock.unlock();
@@ -367,7 +439,7 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
             Servlet servlet, HttpContext httpContext, Dictionary initparams) 
{
         OSGiServletHandler osgiServletHandler;
 
-        if (mapper.containsContext(httpContext)) {
+        if (mapper.containsContext(httpContext) && 
mapper.getContext(httpContext) != null) {
             logger.debug("Reusing ServletHandler");
             // new servlet handler for same configuration, different servlet 
and alias
             List<OSGiServletHandler> servletHandlers = 
mapper.getContext(httpContext);
@@ -386,14 +458,20 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
             } else {
                 params = new HashMap<String, String>(0);
             }
-            osgiServletHandler = new OSGiServletHandler(servlet, 
httpContext, params, logger);
+            OSGiServletContext servletContext = 
mapper.getServletContext(httpContext);
+            osgiServletHandler =
+                    new OSGiServletHandler(servlet,
+                                           httpContext,
+                                           servletContext,
+                                           params,
+                                           logger);
             ArrayList<OSGiServletHandler> servletHandlers = new 
ArrayList<OSGiServletHandler>(1);
             servletHandlers.add(osgiServletHandler);
             mapper.addContext(httpContext, servletHandlers);
+            
osgiServletHandler.setFilterChainFactory(servletContext.getFilterChainFactory());
+
         }
-        osgiServletHandler.addFilter(new OSGiAuthFilter(httpContext),
-                                     "AuthorisationFilter",
-                                     Collections.<String, String>emptyMap());
+
         return osgiServletHandler;
     }
 
@@ -402,7 +480,11 @@ public class OSGiMainHandler extends HttpHandler 
implements OSGiHandler {
         
         final MappingData mappingData = request.obtainMappingData();
         mappingData.contextPath.setString("");
-        mappingData.wrapperPath.setString(alias);
+        if (alias.equals("/")) {
+            mappingData.wrapperPath.setString("");
+        } else {
+            mappingData.wrapperPath.setString(alias);
+        }
         
         if (alias.length() != originalAlias.length()) {
             String pathInfo = originalAlias.substring(alias.length());--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiResourceHandler.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiResourceHandler.java
@@ -68,6 +68,7 @@ public class OSGiResourceHandler extends HttpHandler 
implements OSGiHandler {
     private String alias;
     private String prefix;
     private HttpContext httpContext;
+    private OSGiServletContext servletContext;
     private Logger logger;
 
     /**
@@ -78,13 +79,18 @@ public class OSGiResourceHandler extends HttpHandler 
implements OSGiHandler {
      * @param httpContext Backing {@link org.osgi.service.http.HttpContext}.
      * @param logger      Logger utility.
      */
-    public OSGiResourceHandler(String alias, String prefix, HttpContext 
httpContext, Logger logger) {
+    public OSGiResourceHandler(String alias,
+                               String prefix,
+                               HttpContext httpContext,
+                               OSGiServletContext servletContext,
+                               Logger logger) {
         super();
         //noinspection AccessingNonPublicFieldOfAnotherObject
 //        super.commitErrorResponse = false;
         this.alias = alias;
         this.prefix = prefix;
         this.httpContext = httpContext;
+        this.servletContext = servletContext;
         this.logger = logger;
     }
 
@@ -98,7 +104,7 @@ public class OSGiResourceHandler extends HttpHandler 
implements OSGiHandler {
         String path = requestURI.replaceFirst(alias, prefix);
         try {
             // authentication
-            if (!authenticate(request, response, new 
OSGiServletContext(httpContext, logger))) {
+            if (!authenticate(request, response, servletContext)) {
                 logger.debug("OSGiResourceHandler Request not authenticated 
(" + requestURI + ").");
                 return;
             }--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiServletContext.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiServletContext.java
@@ -41,15 +41,20 @@
 package org.glassfish.grizzly.osgi.httpservice;
 
 import org.glassfish.grizzly.http.util.MimeType;
+import org.glassfish.grizzly.servlet.FilterChainFactory;
+import org.glassfish.grizzly.servlet.FilterRegistration;
 import org.glassfish.grizzly.servlet.WebappContext;
 import org.osgi.service.http.HttpContext;
 import org.glassfish.grizzly.osgi.httpservice.util.Logger;
 
+import javax.servlet.Filter;
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.io.InputStream;
 import java.io.IOException;
 import java.util.EventListener;
+import java.util.Iterator;
+import java.util.Map;
 
 import static java.text.MessageFormat.format;
 
@@ -65,6 +70,10 @@ public class OSGiServletContext extends WebappContext {
     private HttpContext httpContext;
     private Logger logger;
 
+
+    // ------------------------------------------------------------ 
Constructors
+
+
     /**
      * Default constructor.
      *
@@ -74,8 +83,13 @@ public class OSGiServletContext extends WebappContext {
     public OSGiServletContext(HttpContext httpContext, Logger logger) {
         this.httpContext = httpContext;
         this.logger = logger;
+        installAuthFilter(httpContext);
     }
 
+
+    // ---------------------------------------------------------- Public 
Methods
+
+
     /**
      * OSGi integration. Uses {@link HttpContext#getResource(String)}.
      * <p/>
@@ -131,8 +145,43 @@ public class OSGiServletContext extends WebappContext {
         return mime;
     }
 
+
+    // ------------------------------------------------------- Protected 
Methods
+
+
     @Override
     protected EventListener[] getEventListeners() {
         return super.getEventListeners();
     }
+
+    @Override
+    protected FilterChainFactory getFilterChainFactory() {
+        return super.getFilterChainFactory();
+    }
+
+    @Override
+    protected void unregisterFilter(final Filter f) {
+        super.unregisterFilter(f);
+    }
+
+    @Override
+    protected void unregisterAllFilters() {
+        super.unregisterAllFilters();
+    }
+
+
+    // --------------------------------------------------------- Private 
Methods
+
+
+    private void installAuthFilter(HttpContext httpContext) {
+        final Filter f = new OSGiAuthFilter(httpContext);
+        try {
+            f.init(new OSGiFilterConfig(this));
+        } catch (Exception ignored) {
+            // won't happen
+        }
+        FilterRegistration registration =
+                addFilter(Integer.toString(f.hashCode()), f);
+        registration.addMappingForUrlPatterns(null, "/*");
+    }
 }--- 
a/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiServletHandler.java
+++ 
b/extras/grizzly-httpservice/src/main/java/org/glassfish/grizzly/osgi/httpservice/OSGiServletHandler.java
@@ -41,11 +41,10 @@
 package org.glassfish.grizzly.osgi.httpservice;
 
 import org.glassfish.grizzly.Grizzly;
-import org.glassfish.grizzly.http.server.Request;
 import org.glassfish.grizzly.localization.LogMessages;
 import org.glassfish.grizzly.osgi.httpservice.util.Logger;
+import org.glassfish.grizzly.servlet.FilterChainFactory;
 import org.glassfish.grizzly.servlet.FilterChainInvoker;
-import org.glassfish.grizzly.servlet.FilterConfigImpl;
 import org.glassfish.grizzly.servlet.ServletConfigImpl;
 import org.glassfish.grizzly.servlet.WebappContext;
 import org.osgi.service.http.HttpContext;
@@ -80,18 +79,17 @@ public class OSGiServletHandler extends ServletHandler 
implements OSGiHandler {
     private HttpContext httpContext;
     private Logger logger;
     private String servletPath;
-    private FilterChainFactory filterChainFactory;
 
     public OSGiServletHandler(final Servlet servlet,
                               final HttpContext httpContext,
+                              final OSGiServletContext servletContext,
                               final HashMap<String, String> 
servletInitParams,
                               final Logger logger) {
-        super(createServletConfig(new OSGiServletContext(httpContext, 
logger), servletInitParams));
+        super(createServletConfig(servletContext, servletInitParams));
         //noinspection AccessingNonPublicFieldOfAnotherObject
         super.servletInstance = servlet;
         this.httpContext = httpContext;
         this.logger = logger;
-        filterChainFactory = new FilterChainFactory(servlet, 
(OSGiServletContext) getServletCtx());
     }
 
     private OSGiServletHandler(final ServletConfigImpl servletConfig,
@@ -107,6 +105,7 @@ public class OSGiServletHandler extends ServletHandler 
implements OSGiHandler {
 
         servletHandler.setServletInstance(servlet);
         servletHandler.setServletPath(getServletPath());
+        servletHandler.setFilterChainFactory(filterChainFactory);
         //noinspection AccessingNonPublicFieldOfAnotherObject
         servletHandler.httpContext = httpContext;
         return servletHandler;
@@ -155,40 +154,14 @@ public class OSGiServletHandler extends ServletHandler 
implements OSGiHandler {
 
 
     @Override
-    protected FilterChainInvoker getFilterChain(Request request) {
-       return filterChainFactory.createFilterChain();
+    protected void setFilterChainFactory(FilterChainFactory 
filterChainFactory) {
+        super.setFilterChainFactory(filterChainFactory);
     }
 
 
-    protected void addFilter(final Filter filter,
-                             final String name,
-                             final Map<String,String> initParams) {
-        try {
-            filterChainFactory.addFilter(filter, name, initParams);
-        } catch (Exception e) {
-            logger.error(e.toString(), e);
-        }
-
-    }
-
-//    @Override
-//    protected void setPathData(Request from, HttpServletRequestImpl to) {
-//        to.setServletPath(getServletPath());
-//    }
-
     // --------------------------------------------------------- Private 
Methods
 
 
-    private static FilterConfig createFilterConfig(final WebappContext ctx,
-                                                   final String name,
-                                                   final Map<String,String> 
initParams) {
-        final OSGiFilterConfig config = new OSGiFilterConfig(ctx);
-        config.setFilterName(name);
-        config.setInitParameters(initParams);
-        return config;
-
-    }
-
 
     private static ServletConfigImpl createServletConfig(final 
OSGiServletContext ctx,
                                                          final 
Map<String,String> params) {
@@ -202,23 +175,6 @@ public class OSGiServletHandler extends ServletHandler 
implements OSGiHandler {
     // ---------------------------------------------------------- Nested 
Classes
 
 
-    private static final class OSGiFilterConfig extends FilterConfigImpl {
-
-        public OSGiFilterConfig(WebappContext servletContext) {
-            super(servletContext);
-        }
-
-        @Override
-        protected void setFilterName(String filterName) {
-            super.setFilterName(filterName);
-        }
-
-        @Override
-        protected void setInitParameters(Map<String, String> initParameters) 
{
-            super.setInitParameters(initParameters);
-        }
-    }
-
     private static final class OSGiServletConfig extends ServletConfigImpl {
 
         protected OSGiServletConfig(WebappContext servletContextImpl) {
@@ -231,198 +187,4 @@ public class OSGiServletHandler extends ServletHandler 
implements OSGiHandler {
         }
     }
 
-    private static final class FilterChainImpl implements FilterChain, 
FilterChainInvoker {
-
-        private static final java.util.logging.Logger LOGGER = 
Grizzly.logger(FilterChainImpl.class);
-
-        /**
-         * The servlet instance to be executed by this chain.
-         */
-        private final Servlet servlet;
-        private final OSGiServletContext ctx;
-
-        private Filter[] filters;
-        private int filterCount;
-
-
-        /**
-         * The int which is used to maintain the current position
-         * in the filter chain.
-         */
-        private int pos;
-
-        public FilterChainImpl(final Servlet servlet,
-                               final OSGiServletContext ctx,
-                               final Filter[] filters,
-                               final int filterCount) {
-
-            this.servlet = servlet;
-            this.ctx = ctx;
-            this.filters = filters;
-            this.filterCount = filterCount;
-
-        }
-
-        // ---------------------------------------------------- FilterChain 
Methods
-
-
-        public void invokeFilterChain(final ServletRequest request,
-                                      final ServletResponse response)
-        throws IOException, ServletException {
-
-            ServletRequestEvent event =
-                    new ServletRequestEvent(ctx, request);
-            try {
-                requestInitialized(event);
-                pos = 0;
-                doFilter(request, response);
-            } finally {
-                requestDestroyed(event);
-            }
-
-        }
-
-
-        /**
-         * Invoke the next filter in this chain, passing the specified 
request
-         * and response.  If there are no more filters in this chain, invoke
-         * the <code>service()</code> method of the servlet itself.
-         *
-         * @param request  The servlet request we are processing
-         * @param response The servlet response we are creating
-         * @throws java.io.IOException            if an input/output error 
occurs
-         * @throws javax.servlet.ServletException if a servlet exception 
occurs
-         */
-        @Override
-        public void doFilter(ServletRequest request, ServletResponse 
response)
-                throws IOException, ServletException {
-
-            // Call the next filter if there is one
-            if (pos < filterCount) {
-
-                Filter filter = filters[pos++];
-
-                try {
-                    filter.doFilter(request, response, this);
-                } catch (Exception e) {
-                    throw new ServletException(e);
-                }
-
-                return;
-            }
-
-            try {
-                if (servlet != null) {
-                    servlet.service(request, response);
-                }
-
-            } catch (Exception e) {
-                throw new ServletException(e);
-            }
-
-        }
-
-        // --------------------------------------------------------- Private 
Methods
-
-        private void requestDestroyed(ServletRequestEvent event) {
-            // TODO don't create the event unless necessary
-            final EventListener[] listeners = ctx.getEventListeners();
-            for (int i = 0, len = listeners.length; i < len; i++) {
-                if (listeners[i] instanceof ServletRequestListener) {
-                    try {
-                        ((ServletRequestListener) 
listeners[i]).requestDestroyed(event);
-                    } catch (Throwable t) {
-                        if (LOGGER.isLoggable(Level.WARNING)) {
-                            LOGGER.log(Level.WARNING,
-                                    
LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_DESTROYED_ERROR("requestDestroyed",
 "ServletRequestListener", listeners[i].getClass().getName()),
-                                    t);
-                        }
-                    }
-                }
-            }
-
-        }
-
-        private void requestInitialized(ServletRequestEvent event) {
-            final EventListener[] listeners = ctx.getEventListeners();
-            for (int i = 0, len = listeners.length; i < len; i++) {
-                if (listeners[i] instanceof ServletRequestListener) {
-                    try {
-                        ((ServletRequestListener) 
listeners[i]).requestDestroyed(event);
-                    } catch (Throwable t) {
-                        if (LOGGER.isLoggable(Level.WARNING)) {
-                            LOGGER.log(Level.WARNING,
-                                    
LogMessages.WARNING_GRIZZLY_HTTP_SERVLET_CONTAINER_OBJECT_INITIALIZED_ERROR("requestDestroyed",
 "ServletRequestListener", listeners[i].getClass().getName()),
-                                    t);
-                        }
-                    }
-                }
-            }
-        }
-
-    } // END FilterChainImpl
-
-    private static final class FilterChainFactory {
-
-        private final Servlet servlet;
-        private final OSGiServletContext servletContext;
-        private final ReentrantReadWriteLock lock =
-                new ReentrantReadWriteLock
[truncated due to length]



[grizzly~git:d663f8a3] [2.3.x] Initial changes for https://java.net/jira/browse/GRIZZLY-1497 (Su

rlubke 05/17/2013
Terms of Use; Privacy Policy; Copyright ©2013-2016 (revision 20160708.bf2ac18)
 
 
Close
loading
Please Confirm
Close