FELIX-4060 : Implement HTTP Service Update (RFC-189)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1656510 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
index 3cd3301..ca4d465 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
@@ -575,7 +575,7 @@
     @Override
     public RequestDispatcher getNamedDispatcher(final long contextId, final String name)
     {
-        ServletHandler handler = this.handlerRegistry.getServletHandlerByName(name);
+        ServletHandler handler = this.handlerRegistry.getServletHandlerByName(contextId, name);
         return handler != null ? new RequestDispatcherImpl(handler, null) : null;
     }
 
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
index f021884..3ccf78c 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
@@ -31,12 +31,12 @@
 {
     private final RequestDispatcherProvider provider;
 
-    private final long contextId;
+    private final Long contextId;
 
     /**
      * Creates a new {@link ServletContextWrapper} instance.
      */
-    public ServletContextWrapper(long contextId, ExtServletContext delegate, RequestDispatcherProvider provider)
+    public ServletContextWrapper(Long contextId, ExtServletContext delegate, RequestDispatcherProvider provider)
     {
         super(delegate);
 
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
index 62a2e9d..30869e9 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
@@ -121,9 +121,19 @@
         return this.servletPatternMap.get(alias);
     }
 */
-    public ServletHandler getServletHandlerByName(final String name)
+    public ServletHandler getServletHandlerByName(final Long contextId, final String name)
     {
-        // TODO
+        if ( contextId != null )
+        {
+            final List<PerContextHandlerRegistry> regs = this.registrations;
+            for(final PerContextHandlerRegistry r : regs)
+            {
+                if ( contextId == r.getContextServiceid() )
+                {
+                    return r.getServletHandlerByName(name);
+                }
+            }
+        }
         return null;
     }