felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1651612 - /felix/sandbox/http-rfc189/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/ExtenderManager.java
Date Wed, 14 Jan 2015 09:59:24 GMT
Author: cziegeler
Date: Wed Jan 14 09:59:24 2015
New Revision: 1651612

URL: http://svn.apache.org/r1651612
Log:
Set filter and servlet name if not configured

Modified:
    felix/sandbox/http-rfc189/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/ExtenderManager.java

Modified: felix/sandbox/http-rfc189/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/ExtenderManager.java
URL: http://svn.apache.org/viewvc/felix/sandbox/http-rfc189/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/ExtenderManager.java?rev=1651612&r1=1651611&r2=1651612&view=diff
==============================================================================
--- felix/sandbox/http-rfc189/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/ExtenderManager.java
(original)
+++ felix/sandbox/http-rfc189/whiteboard/src/main/java/org/apache/felix/http/whiteboard/internal/manager/ExtenderManager.java
Wed Jan 14 09:59:24 2015
@@ -289,10 +289,14 @@ public final class ExtenderManager
         this.contextManager.ungetHttpContext(bundle, contextId, mapping);
     }
 
-    public void add(Filter service, ServiceReference ref)
+    public void add(final Filter service, final ServiceReference ref)
     {
         FilterInfo filterInfo = new FilterInfo();
         filterInfo.name = getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_NAME);
+        if ( filterInfo.name == null || filterInfo.name.isEmpty() )
+        {
+            filterInfo.name = service.getClass().getName();
+        }
         filterInfo.asyncSupported = getBooleanProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_ASYNC_SUPPORTED);
         filterInfo.servletNames = getStringArrayProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_SERVLET);
         filterInfo.patterns = getStringArrayProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_PATTERN);
@@ -334,6 +338,10 @@ public final class ExtenderManager
     {
         ServletInfo servletInfo = new ServletInfo();
         servletInfo.name = getStringProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME);
+        if ( servletInfo.name == null || servletInfo.name.isEmpty() )
+        {
+            servletInfo.name = service.getClass().getName();
+        }
         servletInfo.errorPage = getStringArrayProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_ERROR_PAGE);
         servletInfo.patterns = getStringArrayProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN);
         servletInfo.asyncSupported = getBooleanProperty(ref, HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_ASYNC_SUPPORTED);
@@ -365,7 +373,7 @@ public final class ExtenderManager
             }
         }
 
-        ServletMapping mapping = new ServletMapping(ref.getBundle(), service, servletInfo);
+        final ServletMapping mapping = new ServletMapping(ref.getBundle(), service, servletInfo);
         servletInfo.context = getHttpContext(mapping, ref); // XXX
         addInitParams(ref, mapping);
         addMapping(TYPE_SERVLET, ref, mapping);



Mime
View raw message