felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1656510 - in /felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal: dispatch/Dispatcher.java dispatch/ServletContextWrapper.java handler/HandlerRegistry.java
Date Mon, 02 Feb 2015 16:21:32 GMT
Author: cziegeler
Date: Mon Feb  2 16:21:32 2015
New Revision: 1656510

URL: http://svn.apache.org/r1656510
Log:
FELIX-4060 : Implement HTTP Service Update (RFC-189)

Modified:
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
    felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java?rev=1656510&r1=1656509&r2=1656510&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/Dispatcher.java
Mon Feb  2 16:21:32 2015
@@ -575,7 +575,7 @@ public final class Dispatcher implements
     @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;
     }
 

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java?rev=1656510&r1=1656509&r2=1656510&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/ServletContextWrapper.java
Mon Feb  2 16:21:32 2015
@@ -31,12 +31,12 @@ class ServletContextWrapper extends Serv
 {
     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);
 

Modified: felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
URL: http://svn.apache.org/viewvc/felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java?rev=1656510&r1=1656509&r2=1656510&view=diff
==============================================================================
--- felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
(original)
+++ felix/trunk/http/base/src/main/java/org/apache/felix/http/base/internal/handler/HandlerRegistry.java
Mon Feb  2 16:21:32 2015
@@ -121,9 +121,19 @@ public final class HandlerRegistry
         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;
     }
 



Mime
View raw message