diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/context/ServletContextImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/context/ServletContextImpl.java
index 905bb03..3eba855 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/context/ServletContextImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/context/ServletContextImpl.java
@@ -75,150 +75,180 @@
         this.attributes = impl.attributes;
     }
 
+    @Override
     public FilterRegistration.Dynamic addFilter(String filterName, Class<? extends Filter> type)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public FilterRegistration.Dynamic addFilter(String filterName, Filter filter)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public FilterRegistration.Dynamic addFilter(String filterName, String className)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void addListener(Class<? extends EventListener> type)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void addListener(String className)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public <T extends EventListener> void addListener(T listener)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public ServletRegistration.Dynamic addServlet(String servletName, Class<? extends Servlet> type)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public ServletRegistration.Dynamic addServlet(String servletName, String className)
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public <T extends Filter> T createFilter(Class<T> type) throws ServletException
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public <T extends EventListener> T createListener(Class<T> type) throws ServletException
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public <T extends Servlet> T createServlet(Class<T> type) throws ServletException
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public void declareRoles(String... roleNames)
     {
         this.context.declareRoles(roleNames);
     }
 
+    @Override
     public String getVirtualServerName() {
         return context.getVirtualServerName();
     }
 
+    @Override
     public Object getAttribute(String name)
     {
         return (this.attributes != null) ? this.attributes.get(name) : this.context.getAttribute(name);
     }
 
-    public Enumeration getAttributeNames()
+    @Override
+    public Enumeration<String> getAttributeNames()
     {
         return (this.attributes != null) ? Collections.enumeration(this.attributes.keySet()) : this.context.getAttributeNames();
     }
 
+    @Override
     public ClassLoader getClassLoader()
     {
         return bundle.getClass().getClassLoader();
     }
 
+    @Override
     public ServletContext getContext(String uri)
     {
         return this.context.getContext(uri);
     }
 
+    @Override
     public String getContextPath()
     {
         return this.context.getContextPath();
     }
 
+    @Override
     public Set<SessionTrackingMode> getDefaultSessionTrackingModes()
     {
         return this.context.getDefaultSessionTrackingModes();
     }
 
+    @Override
     public int getEffectiveMajorVersion()
     {
         return this.context.getEffectiveMajorVersion();
     }
 
+    @Override
     public int getEffectiveMinorVersion()
     {
         return this.context.getEffectiveMinorVersion();
     }
 
+    @Override
     public Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
     {
         return this.context.getEffectiveSessionTrackingModes();
     }
 
+    @Override
     public FilterRegistration getFilterRegistration(String filterName)
     {
         return this.context.getFilterRegistration(filterName);
     }
 
+    @Override
     public Map<String, ? extends FilterRegistration> getFilterRegistrations()
     {
         return this.context.getFilterRegistrations();
     }
 
+    @Override
     public String getInitParameter(String name)
     {
         return this.context.getInitParameter(name);
     }
 
-    public Enumeration getInitParameterNames()
+    @Override
+    public Enumeration<String> getInitParameterNames()
     {
         return this.context.getInitParameterNames();
     }
 
+    @Override
     public JspConfigDescriptor getJspConfigDescriptor()
     {
         throw new UnsupportedOperationException();
     }
 
+    @Override
     public int getMajorVersion()
     {
         return this.context.getMajorVersion();
     }
 
+    @Override
     public String getMimeType(String file)
     {
         String type = this.httpContext.getMimeType(file);
@@ -230,16 +260,19 @@
         return MimeTypes.get().getByFile(file);
     }
 
+    @Override
     public int getMinorVersion()
     {
         return this.context.getMinorVersion();
     }
 
+    @Override
     public RequestDispatcher getNamedDispatcher(String name)
     {
         return this.context.getNamedDispatcher(name);
     }
 
+    @Override
     public String getRealPath(String name)
     {
         URL url = getResource(name);
@@ -250,16 +283,19 @@
         return url.toExternalForm();
     }
 
+    @Override
     public RequestDispatcher getRequestDispatcher(String uri)
     {
         return this.context.getRequestDispatcher(uri);
     }
 
+    @Override
     public URL getResource(String path)
     {
         return this.httpContext.getResource(normalizeResourcePath(path));
     }
 
+    @Override
     public InputStream getResourceAsStream(String path)
     {
         URL res = getResource(path);
@@ -277,9 +313,10 @@
         return null;
     }
 
-    public Set getResourcePaths(String path)
+    @Override
+    public Set<String> getResourcePaths(String path)
     {
-        Enumeration paths = this.bundle.getEntryPaths(normalizePath(path));
+        Enumeration<String> paths = this.bundle.getEntryPaths(normalizePath(path));
         if ((paths == null) || !paths.hasMoreElements())
         {
             return null;
@@ -288,72 +325,85 @@
         Set<String> set = new HashSet<String>();
         while (paths.hasMoreElements())
         {
-            set.add((String) paths.nextElement());
+            set.add(paths.nextElement());
         }
 
         return set;
     }
 
+    @Override
     public String getServerInfo()
     {
         return this.context.getServerInfo();
     }
 
+    @Override
     public Servlet getServlet(String name) throws ServletException
     {
         return this.context.getServlet(name);
     }
 
+    @Override
     public String getServletContextName()
     {
         return this.context.getServletContextName();
     }
 
-    public Enumeration getServletNames()
+    @Override
+    public Enumeration<String> getServletNames()
     {
         return this.context.getServletNames();
     }
 
+    @Override
     public ServletRegistration getServletRegistration(String servletName)
     {
         return this.context.getServletRegistration(servletName);
     }
 
+    @Override
     public Map<String, ? extends ServletRegistration> getServletRegistrations()
     {
         return this.context.getServletRegistrations();
     }
 
-    public Enumeration getServlets()
+    @Override
+    public Enumeration<Servlet> getServlets()
     {
         return this.context.getServlets();
     }
 
+    @Override
     public SessionCookieConfig getSessionCookieConfig()
     {
         return this.context.getSessionCookieConfig();
     }
 
+    @Override
     public boolean handleSecurity(HttpServletRequest req, HttpServletResponse res) throws IOException
     {
         return this.httpContext.handleSecurity(req, res);
     }
 
+    @Override
     public void log(Exception cause, String message)
     {
         SystemLogger.error(message, cause);
     }
 
+    @Override
     public void log(String message)
     {
         SystemLogger.info(message);
     }
 
+    @Override
     public void log(String message, Throwable cause)
     {
         SystemLogger.error(message, cause);
     }
 
+    @Override
     public void removeAttribute(String name)
     {
         Object oldValue;
@@ -373,6 +423,7 @@
         }
     }
 
+    @Override
     public void setAttribute(String name, Object value)
     {
         if (value == null)
@@ -403,11 +454,13 @@
         }
     }
 
+    @Override
     public boolean setInitParameter(String name, String value)
     {
         return this.context.setInitParameter(name, value);
     }
 
+    @Override
     public void setSessionTrackingModes(Set<SessionTrackingMode> modes)
     {
         this.context.setSessionTrackingModes(modes);
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterConfigImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterConfigImpl.java
index f0bcdab..4f91043 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterConfigImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/FilterConfigImpl.java
@@ -16,11 +16,12 @@
  */
 package org.apache.felix.http.base.internal.handler;
 
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Map;
+
 import javax.servlet.FilterConfig;
 import javax.servlet.ServletContext;
-import java.util.Enumeration;
-import java.util.Collections;
-import java.util.Map;
 
 public final class FilterConfigImpl implements FilterConfig
 {
@@ -28,29 +29,33 @@
     private final ServletContext context;
     private final Map<String, String> initParams;
 
-    public FilterConfigImpl(String name, ServletContext context, Map<String, String> initParams)
+    public FilterConfigImpl(final String name, final ServletContext context, final Map<String, String> initParams)
     {
         this.name = name;
         this.context = context;
         this.initParams = initParams;
     }
 
+    @Override
     public String getFilterName()
     {
         return this.name;
     }
 
+    @Override
     public ServletContext getServletContext()
     {
         return this.context;
     }
 
+    @Override
     public String getInitParameter(String name)
     {
         return this.initParams.get(name);
     }
 
-    public Enumeration getInitParameterNames()
+    @Override
+    public Enumeration<String> getInitParameterNames()
     {
         return Collections.enumeration(this.initParams.keySet());
     }
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletConfigImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletConfigImpl.java
index c3a0c7f..3d072ce 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletConfigImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletConfigImpl.java
@@ -16,41 +16,46 @@
  */
 package org.apache.felix.http.base.internal.handler;
 
-import javax.servlet.ServletContext;
-import javax.servlet.ServletConfig;
-import java.util.Enumeration;
 import java.util.Collections;
+import java.util.Enumeration;
 import java.util.Map;
 
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+
 public final class ServletConfigImpl implements ServletConfig
 {
     private final String name;
     private final ServletContext context;
     private final Map<String, String> initParams;
 
-    public ServletConfigImpl(String name, ServletContext context, Map<String, String> initParams)
+    public ServletConfigImpl(final String name, final ServletContext context, final Map<String, String> initParams)
     {
         this.name = name;
         this.context = context;
         this.initParams = initParams;
     }
 
+    @Override
     public String getServletName()
     {
         return this.name;
     }
 
+    @Override
     public ServletContext getServletContext()
     {
         return this.context;
     }
 
+    @Override
     public String getInitParameter(String name)
     {
         return this.initParams.get(name);
     }
 
-    public Enumeration getInitParameterNames()
+    @Override
+    public Enumeration<String> getInitParameterNames()
     {
         return Collections.enumeration(this.initParams.keySet());
     }
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java b/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java
index cae272b..ecf850a 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/service/HttpServiceFactory.java
@@ -23,9 +23,10 @@
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceFactory;
 import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.http.HttpService;
 
 public final class HttpServiceFactory
-    implements ServiceFactory
+    implements ServiceFactory<HttpService>
 {
     private final ServletContext context;
     private final ServletContextAttributeListener attributeListener;
@@ -42,15 +43,21 @@
     }
 
     @Override
-    public Object getService(Bundle bundle, ServiceRegistration reg)
+    public HttpService getService(final Bundle bundle, final ServiceRegistration<HttpService> reg)
     {
-        return new HttpServiceImpl(bundle, this.context, this.handlerRegistry.getRegistry(null), this.attributeListener,
-            this.sharedContextAttributes);
+        return new HttpServiceImpl(bundle, this.context,
+                this.handlerRegistry.getRegistry(null),
+                this.attributeListener,
+                this.sharedContextAttributes);
     }
 
     @Override
-    public void ungetService(Bundle bundle, ServiceRegistration reg, Object service)
+    public void ungetService(final Bundle bundle, final ServiceRegistration<HttpService> reg,
+            final HttpService service)
     {
-        ((HttpServiceImpl)service).unregisterAll();
+        if ( service instanceof HttpServiceImpl )
+        {
+            ((HttpServiceImpl)service).unregisterAll();
+        }
     }
 }
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
index 9b3d56e..7fce2e4 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
@@ -84,21 +84,18 @@
     @Override
     public URL getResource(final String path)
     {
-        // is implemented by {@link PerBundleServletContextImpl}.
         return this.contextHelper.getResource(path);
     }
 
     @Override
     public String getMimeType(final String name)
     {
-        // is implemented by {@link PerBundleServletContextImpl}.
         return this.contextHelper.getMimeType(name);
     }
 
     @Override
     public String getRealPath(final String path)
     {
-        // is implemented by {@link PerBundleServletContextImpl}.
         return this.contextHelper.getRealPath(path);
     }
 
@@ -162,18 +159,21 @@
         return delegatee.getNamedDispatcher(name);
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public Servlet getServlet(String name) throws ServletException
     {
         return delegatee.getServlet(name);
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public Enumeration<Servlet> getServlets()
     {
         return delegatee.getServlets();
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public Enumeration<String> getServletNames()
     {
@@ -186,6 +186,7 @@
         delegatee.log(msg);
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public void log(Exception exception, String msg)
     {
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/ResourceServlet.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/ResourceServlet.java
index 50155b6..e53e835 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/ResourceServlet.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/ResourceServlet.java
@@ -28,29 +28,28 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+/**
+ * The resource servlet used for resource whiteboard registrations.
+ */
 public final class ResourceServlet extends HttpServlet
 {
-    private final String path;
+    private static final long serialVersionUID = 1L;
 
-    public ResourceServlet(final String path)
+    /** The path of the resource registration. */
+    private final String prefix;
+
+    public ResourceServlet(final String prefix)
     {
-        this.path = path;
+        this.prefix = prefix;
     }
 
     @Override
-    protected void doGet(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException
+    protected void doGet(final HttpServletRequest req, final HttpServletResponse res)
+            throws ServletException, IOException
     {
         final String target = req.getPathInfo();
-        final String resName;
-        if (target == null)
-        {
-            resName = this.path;
-        }
-        else
-        {
-        	resName = this.path + target;
-        }
-        
+        final String resName = (target == null ? this.prefix : this.prefix + target);
+
         final URL url = getServletContext().getResource(resName);
 
         if (url == null)
@@ -63,16 +62,17 @@
         }
     }
 
-    private void handle(final HttpServletRequest req, final HttpServletResponse res, final URL url, final String resName)  
+    private void handle(final HttpServletRequest req,
+            final HttpServletResponse res, final URL url, final String resName)
     throws IOException
     {
-        String contentType = getServletContext().getMimeType(resName);
+        final String contentType = getServletContext().getMimeType(resName);
         if (contentType != null)
         {
             res.setContentType(contentType);
         }
 
-        long lastModified = getLastModified(url);
+        final long lastModified = getLastModified(url);
         if (lastModified != 0)
         {
             res.setDateHeader("Last-Modified", lastModified);
@@ -88,26 +88,26 @@
         }
     }
 
-    private long getLastModified(URL url)
+    private long getLastModified(final URL url)
     {
         long lastModified = 0;
 
         try
         {
-            URLConnection conn = url.openConnection();
+            final URLConnection conn = url.openConnection();
             lastModified = conn.getLastModified();
         }
-        catch (Exception e)
+        catch (final Exception e)
         {
             // Do nothing
         }
 
         if (lastModified == 0)
         {
-            String filepath = url.getPath();
+            final String filepath = url.getPath();
             if (filepath != null)
             {
-                File f = new File(filepath);
+                final File f = new File(filepath);
                 if (f.exists())
                 {
                     lastModified = f.lastModified();
@@ -126,7 +126,7 @@
         return resTimestamp == 0 || modSince == -1 || resTimestamp > modSince;
     }
 
-    private void copyResource(URL url, HttpServletResponse res) throws IOException
+    private void copyResource(final URL url, final HttpServletResponse res) throws IOException
     {
         URLConnection conn = null;
         OutputStream os = null;
@@ -138,7 +138,7 @@
 
             is = conn.getInputStream();
             os = res.getOutputStream();
-            // FELIX-3987 content length should be set *before* any streaming is done 
+            // FELIX-3987 content length should be set *before* any streaming is done
             // as headers should be written before the content is actually written...
             int len = getContentLength(conn);
             if (len >= 0)
@@ -168,20 +168,20 @@
         }
     }
 
-    private int getContentLength(URLConnection conn)
+    private int getContentLength(final URLConnection conn)
     {
         int length = -1;
 
         length = conn.getContentLength();
         if (length < 0)
         {
-            // Unknown, try whether it is a file, and if so, use the file 
+            // Unknown, try whether it is a file, and if so, use the file
             // API to get the length of the content...
             String path = conn.getURL().getPath();
             if (path != null)
             {
                 File f = new File(path);
-                // In case more than 2GB is streamed 
+                // In case more than 2GB is streamed
                 if (f.length() < Integer.MAX_VALUE)
                 {
                     length = (int) f.length();
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/SharedServletContextImpl.java b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/SharedServletContextImpl.java
index 0a82c78..8b934fd 100644
--- a/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/SharedServletContextImpl.java
+++ b/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/SharedServletContextImpl.java
@@ -209,7 +209,7 @@
     }
 
     @Override
-    public Enumeration getAttributeNames()
+    public Enumeration<String> getAttributeNames()
     {
         return Collections.enumeration(this.attributes.keySet());
     }
@@ -269,7 +269,7 @@
     }
 
     @Override
-    public Enumeration getInitParameterNames()
+    public Enumeration<String> getInitParameterNames()
     {
         return Collections.enumeration(this.initParameters.keySet());
     }
@@ -330,6 +330,7 @@
         return this.context.getServerInfo();
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public Servlet getServlet(final String name) throws ServletException
     {
@@ -342,8 +343,9 @@
         return this.name;
     }
 
+    @SuppressWarnings("deprecation")
     @Override
-    public Enumeration getServletNames()
+    public Enumeration<String> getServletNames()
     {
         return this.context.getServletNames();
     }
@@ -360,8 +362,9 @@
         return this.context.getServletRegistrations();
     }
 
+    @SuppressWarnings("deprecation")
     @Override
-    public Enumeration getServlets()
+    public Enumeration<Servlet> getServlets()
     {
         return this.context.getServlets();
     }
