Update to latest http whiteboard api

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1676271 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/api/src/main/java/org/osgi/service/http/context/ServletContextHelper.java b/http/api/src/main/java/org/osgi/service/http/context/ServletContextHelper.java
index a75d2d0..9e6f2e8 100644
--- a/http/api/src/main/java/org/osgi/service/http/context/ServletContextHelper.java
+++ b/http/api/src/main/java/org/osgi/service/http/context/ServletContextHelper.java
@@ -19,7 +19,7 @@
 import java.io.IOException;
 import java.net.URL;
 import java.util.Enumeration;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.Set;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -32,31 +32,33 @@
  * to serve HTTP requests.
  *
  * <p>
- * This service defines methods that the Http Whiteboard Implementation may call
+ * This service defines methods that the Http Whiteboard implementation may call
  * to get information for a request when dealing with whiteboard services.
  * 
  * <p>
  * Each {@code ServletContextHelper} is registered with a
- * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME service property}
- * containing a name to reference by servlets, servlet filters, resources, and
- * listeners. If there is more than one {@code ServletContextHelper} registered
- * with the same context name, the one with the highest service ranking is
- * active, the others are inactive.
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME
+ * "osgi.http.whiteboard.context.name"} service property containing a name to
+ * reference by servlets, servlet filters, resources, and listeners. If there is
+ * more than one {@code ServletContextHelper} registered with the same context
+ * name, the one with the highest service ranking is active, the others are
+ * inactive.
  * 
  * <p>
  * A context is registered with the
- * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH service property}
- * to define a path under which all services registered with this context are
- * reachable. If there is more than one {@code ServletContextHelper} registered
- * with the same path, each duplicate context path is searched by service
- * ranking order according to
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH
+ * "osgi.http.whiteboard.context.path"} service property to define a path under
+ * which all services registered with this context are reachable. If there is
+ * more than one {@code ServletContextHelper} registered with the same path,
+ * each duplicate context path is searched by service ranking order according to
  * {@link org.osgi.framework.ServiceReference#compareTo(Object)} until a
  * matching servlet or resource is found.
  * 
  * <p>
  * Servlets, servlet filters, resources, and listeners services may be
- * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT associated}
- * with a {@code ServletContextHelper} service. If the referenced
+ * associated with a {@code ServletContextHelper} service with the
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
+ * "osgi.http.whiteboard.context.select"} service property. If the referenced
  * {@code ServletContextHelper} service does not exist or is currently not
  * active, the whiteboard services for that {@code ServletContextHelper} are not
  * active either.
@@ -64,11 +66,11 @@
  * <p>
  * If no {@code ServletContextHelper} service is associated, that is no
  * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
- * HTTP_WHITEBOARD_CONTEXT_SELECT} is configured for a whiteboard service, a
- * default {@code ServletContextHelper} is used.
+ * "osgi.http.whiteboard.context.select"} service property is configured for a
+ * whiteboard service, a default {@code ServletContextHelper} is used.
  * 
  * <p>
- * Those whiteboard services that are associated using the same
+ * Those whiteboard services that are associated with the same
  * {@code ServletContextHelper} object will share the same
  * {@code ServletContext} object.
  * 
@@ -76,23 +78,22 @@
  * The behavior of the methods on the default {@code ServletContextHelper} is
  * defined as follows:
  * <ul>
- * <li>{@code getMimeType} - Does not define any customized MIME types for the
- * {@code Content-Type} header in the response, and always returns {@code null}.
- * </li>
- * <li>{@code handleSecurity} - Performs implementation-defined authentication
- * on the request.</li>
- * <li>{@code getResource} - Assumes the named resource is in the bundle of the
- * whiteboard service, addressed from the root. This method calls the whiteboard
- * service bundle's {@code Bundle.getEntry} method, and returns the appropriate
- * URL to access the resource. On a Java runtime environment that supports
- * permissions, the Http Whiteboard Implementation needs to be granted
+ * <li>{@link #getMimeType(String) getMimeType} - Always returns {@code null}.</li>
+ * <li>{@link #handleSecurity(HttpServletRequest, HttpServletResponse)
+ * handleSecurity} - Always returns {@code true}.</li>
+ * <li>{@link #getResource(String) getResource} - Assumes the named resource is
+ * in the bundle of the whiteboard service, addressed from the root. This method
+ * calls the whiteboard service bundle's {@code Bundle.getEntry} method, and
+ * returns the appropriate URL to access the resource. On a Java runtime
+ * environment that supports permissions, the Http Whiteboard implementation
+ * needs to be granted {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.</li>
+ * <li>{@link #getResourcePaths(String) getResourcePaths} - Assumes that the
+ * resources are in the bundle of the whiteboard service. This method calls
+ * {@code Bundle.findEntries} method, and returns the found entries. On a Java
+ * runtime environment that supports permissions, the Http Whiteboard
+ * implementation needs to be granted
  * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.</li>
- * <li>{@code getResourcePaths} - Assumes that the resources are in the bundle
- * of the whiteboard service. This method calls {@code Bundle.findEntries}
- * method, and returns the found entries. On a Java runtime environment that
- * supports permissions, the Http Whiteboard Implementation needs to be granted
- * {@code org.osgi.framework.AdminPermission[*,RESOURCE]}.</li>
- * <li>{@code getRealPath} - This method returns {@code null}.</li>
+ * <li>{@link #getRealPath(String) getRealPath} - Always returns {@code null}.</li>
  * </ul>
  * 
  * @ThreadSafe
@@ -105,23 +106,21 @@
 	/**
 	 * {@code HttpServletRequest} attribute specifying the name of the
 	 * authenticated user. The value of the attribute can be retrieved by
-	 * {@code HttpServletRequest.getRemoteUser}. This attribute name is
-	 * {@code org.osgi.service.http.authentication.remote.user}.
+	 * {@code HttpServletRequest.getRemoteUser}.
 	 */
 	public static final String	REMOTE_USER			= "org.osgi.service.http.authentication.remote.user";
 	/**
 	 * {@code HttpServletRequest} attribute specifying the scheme used in
 	 * authentication. The value of the attribute can be retrieved by
-	 * {@code HttpServletRequest.getAuthType}. This attribute name is
-	 * {@code org.osgi.service.http.authentication.type}.
+	 * {@code HttpServletRequest.getAuthType}.
 	 */
 	public static final String	AUTHENTICATION_TYPE	= "org.osgi.service.http.authentication.type";
 	/**
 	 * {@code HttpServletRequest} attribute specifying the {@code Authorization}
 	 * object obtained from the {@code org.osgi.service.useradmin.UserAdmin}
 	 * service. The value of the attribute can be retrieved by
-	 * {@code HttpServletRequest.getAttribute(HttpContext.AUTHORIZATION)}. This
-	 * attribute name is {@code org.osgi.service.useradmin.authorization}.
+	 * {@code HttpServletRequest.getAttribute(ServletContextHelper.AUTHORIZATION)}
+	 * .
 	 */
 	public static final String	AUTHORIZATION		= "org.osgi.service.useradmin.authorization";
 
@@ -129,38 +128,40 @@
 	private final Bundle		bundle;
 
 	/**
-	 * Default constructor
+	 * Construct a new context helper.
+	 * 
+	 * <p>
+	 * If needed, the subclass will have to handle the association with a
+	 * specific bundle.
 	 */
 	public ServletContextHelper() {
-		// default constructor
 		this(null);
 	}
 
 	/**
-	 * Construct a new context helper and set the bundle associated with this
-	 * context.
+	 * Construct a new context helper associated with the specified bundle.
 	 * 
-	 * @param b The bundle
+	 * @param bundle The bundle to be associated with this context helper.
 	 */
-	public ServletContextHelper(final Bundle b) {
-		this.bundle = b;
+	public ServletContextHelper(final Bundle bundle) {
+		this.bundle = bundle;
 	}
 
 	/**
 	 * Handles security for the specified request.
 	 * 
 	 * <p>
-	 * The Http Whiteboard Implementation calls this method prior to servicing
+	 * The Http Whiteboard implementation calls this method prior to servicing
 	 * the specified request. This method controls whether the request is
 	 * processed in the normal manner or an error is returned.
 	 * 
 	 * <p>
-	 * If the request requires authentication and the Authorization header in
-	 * the request is missing or not acceptable, then this method should set the
-	 * WWW-Authenticate header in the response object, set the status in the
-	 * response object to Unauthorized(401) and return {@code false}. See also
-	 * RFC 2617: <i>HTTP Authentication: Basic and Digest Access Authentication
-	 * </i> (available at http://www.ietf.org/rfc/rfc2617.txt).
+	 * If the request requires authentication and the {@code Authorization}
+	 * header in the request is missing or not acceptable, then this method
+	 * should set the {@code WWW-Authenticate} header in the response object,
+	 * set the status in the response object to Unauthorized(401) and return
+	 * {@code false}. See also <a href="http://www.ietf.org/rfc/rfc2617.txt">RFC
+	 * 2617: HTTP Authentication: Basic and Digest Access Authentication</a>.
 	 * 
 	 * <p>
 	 * If the request requires a secure connection and the {@code getScheme}
@@ -170,9 +171,9 @@
 	 * 
 	 * <p>
 	 * When this method returns {@code false}, the Http Whiteboard
-	 * Implementation will send the response back to the client, thereby
+	 * implementation will send the response back to the client, thereby
 	 * completing the request. When this method returns {@code true}, the Http
-	 * Whitboard Implementation will proceed with servicing the request.
+	 * Whiteboard implementation will proceed with servicing the request.
 	 * 
 	 * <p>
 	 * If the specified request has been authenticated, this method must set the
@@ -198,13 +199,13 @@
 	 * @param response The HTTP response.
 	 * @return {@code true} if the request should be serviced, {@code false} if
 	 *         the request should not be serviced and Http Whiteboard
-	 *         Implementation will send the response back to the client.
-	 * @throws java.io.IOException may be thrown by this method. If this occurs,
-	 *         the Http Whiteboard Implementation will terminate the request and
+	 *         implementation will send the response back to the client.
+	 * @throws java.io.IOException May be thrown by this method. If this occurs,
+	 *         the Http Whiteboard implementation will terminate the request and
 	 *         close the socket.
 	 */
 	public boolean handleSecurity(final HttpServletRequest request,
-			                      final HttpServletResponse response)
+			final HttpServletResponse response)
 			throws IOException {
 		return true;
 	}
@@ -213,31 +214,30 @@
 	 * Maps a resource name to a URL.
 	 * 
 	 * <p>
-	 * Called by the Http Whiteboard Implementation to map the specified
-	 * resource name to a URL. For servlets, the Http Whiteboard Implementation
+	 * Called by the Http Whiteboard implementation to map the specified
+	 * resource name to a URL. For servlets, the Http Whiteboard implementation
 	 * will call this method to support the {@code ServletContext} methods
 	 * {@code getResource} and {@code getResourceAsStream}. For resources, the
-	 * Http Whiteboard Implementation will call this method to locate the named
+	 * Http Whiteboard implementation will call this method to locate the named
 	 * resource.
 	 * 
 	 * <p>
 	 * The context can control from where resources come. For example, the
 	 * resource can be mapped to a file in the bundle's persistent storage area
-	 * via {@code bundleContext.getDataFile(name).toURL()} or to a resource in
-	 * the context's bundle via {@code getClass().getResource(name)}
+	 * via {@code BundleContext.getDataFile(name).toURI().toURL()} or to a
+	 * resource in the context's bundle via {@code getClass().getResource(name)}
 	 * 
 	 * @param name The name of the requested resource.
-	 * @return A URL that a Http Whiteboard Implementation can use to read the
+	 * @return A URL that a Http Whiteboard implementation can use to read the
 	 *         resource or {@code null} if the resource does not exist.
 	 */
 	public URL getResource(String name) {
-		final Bundle localBundle = this.bundle;
-		if (name != null && localBundle != null) {
+		if ((name != null) && (bundle != null)) {
 			if (name.startsWith("/")) {
 				name = name.substring(1);
 			}
 
-			return this.bundle.getEntry(name);
+			return bundle.getEntry(name);
 		}
 		return null;
 	}
@@ -246,17 +246,17 @@
 	 * Maps a name to a MIME type.
 	 * 
 	 * <p>
-	 * Called by the Http Whiteboard Implementation to determine the MIME type
+	 * Called by the Http Whiteboard implementation to determine the MIME type
 	 * for the specified name. For whiteboard services, the Http Whiteboard
-	 * Implementation will call this method to support the
+	 * implementation will call this method to support the
 	 * {@code ServletContext} method {@code getMimeType}. For resource servlets,
-	 * the Http Whiteboard Implementation will call this method to determine the
+	 * the Http Whiteboard implementation will call this method to determine the
 	 * MIME type for the {@code Content-Type} header in the response.
 	 *
 	 * @param name The name for which to determine the MIME type.
 	 * @return The MIME type (e.g. text/html) of the specified name or
-	 *         {@code null} to indicate that the Http Service should determine
-	 *         the MIME type itself.
+	 *         {@code null} to indicate that the Http Whiteboard implementation
+	 *         should determine the MIME type itself.
 	 */
 	public String getMimeType(final String name) {
 		return null;
@@ -268,22 +268,21 @@
 	 * argument.
 	 * 
 	 * <p>
-	 * Called by the Http Whiteboard Implementation to support the
+	 * Called by the Http Whiteboard implementation to support the
 	 * {@code ServletContext} method {@code getResourcePaths} for whiteboard
 	 * services.
 	 * 
-	 * @param path the partial path used to match the resources, which must
-	 *        start with a /
-	 * @return a Set containing the directory listing, or null if there are no
-	 *         resources in the web application whose path begins with the
-	 *         supplied path.
+	 * @param path The partial path used to match the resources, which must
+	 *        start with a /.
+	 * @return A Set containing the directory listing, or {@code null} if there
+	 *         are no resources in the web application whose path begins with
+	 *         the supplied path.
 	 */
 	public Set<String> getResourcePaths(final String path) {
-		final Bundle localBundle = this.bundle;
-		if (path != null && localBundle != null) {
-			final Enumeration<URL> e = localBundle.findEntries(path, null, false);
+		if ((path != null) && (bundle != null)) {
+			final Enumeration<URL> e = bundle.findEntries(path, null, false);
 			if (e != null) {
-				final Set<String> result = new HashSet<String>();
+				final Set<String> result = new LinkedHashSet<String>();
 				while (e.hasMoreElements()) {
 					result.add(e.nextElement().getPath());
 				}
@@ -297,12 +296,13 @@
 	 * Gets the real path corresponding to the given virtual path.
 	 * 
 	 * <p>
-	 * Called by the Http Whiteboard Implementation to support the
+	 * Called by the Http Whiteboard implementation to support the
 	 * {@code ServletContext} method {@code getRealPath} for whiteboard
 	 * services.
 	 * 
-	 * @param path the virtual path to be translated to a real path
-	 * @return the real path, or null if the translation cannot be performed
+	 * @param path The virtual path to be translated to a real path.
+	 * @return The real path, or {@code null} if the translation cannot be
+	 *         performed.
 	 */
 	public String getRealPath(final String path) {
 		return null;
diff --git a/http/api/src/main/java/org/osgi/service/http/context/package-info.java b/http/api/src/main/java/org/osgi/service/http/context/package-info.java
index 906ef61..b6795f2 100644
--- a/http/api/src/main/java/org/osgi/service/http/context/package-info.java
+++ b/http/api/src/main/java/org/osgi/service/http/context/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
  */
 
 /**
- * Http Service Context Package Version 1.0.
+ * Http Whiteboard Context Package Version 1.0.
  * 
  * <p>
  * Bundles wishing to use this package must list the package in the
diff --git a/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntime.java b/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntime.java
index d854f83..09d6cb7 100644
--- a/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntime.java
+++ b/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntime.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2012, 2015). All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,15 +21,15 @@
 import org.osgi.service.http.runtime.dto.RuntimeDTO;
 
 /**
- * The {@code HttpServiceRuntime} service represents the runtime information of
- * a Http (Whiteboard) Implementation.
+ * The HttpServiceRuntime service represents the runtime information of an Http
+ * Whiteboard implementation.
  *
  * <p>
  * It provides access to DTOs representing the current state of the service.
  * <p>
- * The {@code HttpServiceRuntime} service must at least be registered with the
- * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT_ATTRIBUTE}
- * attribute.
+ * The HttpServiceRuntime service must be registered with the
+ * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT} service
+ * property.
  *
  * @ThreadSafe
  * @author $Id$
@@ -39,17 +39,18 @@
 
 	/**
 	 * Return the runtime DTO representing the current state.
-	 * @return The runtime DTO
+	 * 
+	 * @return The runtime DTO.
 	 */
 	public RuntimeDTO getRuntimeDTO();
-	
+
 	/**
-	 * Return a request info DTO containing the services
-	 * involved with processing a request for the given
-	 * path.
-	 * @param path The request path, relative to the root of the
-	 *             Http (Whiteboard) Service.
-	 * @return A request info DTO
+	 * Return a request info DTO containing the services involved with
+	 * processing a request for the specified path.
+	 * 
+	 * @param path The request path, relative to the root of the Http Whiteboard
+	 *        implementation.
+	 * @return The request info DTO for the specified path.
 	 */
 	public RequestInfoDTO calculateRequestInfoDTO(String path);
 }
diff --git a/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java b/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java
index 7853f0d..264c3ae 100644
--- a/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java
+++ b/http/api/src/main/java/org/osgi/service/http/runtime/HttpServiceRuntimeConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2012, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
 
 package org.osgi.service.http.runtime;
 
-
 /**
  * Defines standard names for Http Runtime Service constants.
  * 
@@ -28,38 +27,40 @@
 	}
 
 	/**
-	 * Http Runtime Service registration property specifying the endpoints upon
-	 * which the Http Service Runtime is listening.
+	 * Http Runtime Service service property specifying the endpoints upon which
+	 * the Http Whiteboard implementation is listening.
 	 * 
 	 * <p>
-	 * An endpoint value is a URL or a relative path, to which the Http service
-	 * runtime is listening. For example, {@code http://192.168.1.10:8080/} or
-	 * {@code /myapp/}. A relative path may be used if the scheme and authority
-	 * parts of the URL are not known, e.g. in a bridged Http Service
-	 * implementation. If the Http Service implementation is serving the root
-	 * context and neither scheme nor authority is known, the value of the
-	 * property is "/". Both, a URL and a relative path, must end with a slash.
+	 * An endpoint value is a URL or a relative path, to which the Http
+	 * Whiteboard implementation is listening. For example,
+	 * {@code http://192.168.1.10:8080/} or {@code /myapp/}. A relative path may
+	 * be used if the scheme and authority parts of the URL are not known, e.g.
+	 * in a bridged Http Whiteboard implementation. If the Http Whiteboard
+	 * implementation is serving the root context and neither scheme nor
+	 * authority is known, the value of the property is "/". Both, a URL and a
+	 * relative path, must end with a slash.
 	 * <p>
-	 * An Http Service Runtime can be listening on multiple endpoints.
+	 * An Http Whiteboard implementation can be listening on multiple endpoints.
 	 * 
 	 * <p>
-	 * The value of this attribute must be of type {@code String},
+	 * The value of this service property must be of type {@code String},
 	 * {@code String[]}, or {@code Collection<String>}.
 	 */
-	public static final String	HTTP_SERVICE_ENDPOINT_ATTRIBUTE			= "osgi.http.endpoint";
+	public static final String	HTTP_SERVICE_ENDPOINT	= "osgi.http.endpoint";
 
 	/**
-	 * Http Runtime Service registration property to associate the Http Runtime
-	 * Service with one or more Http Service registrations.
+	 * Http Runtime Service service property to associate the Http Runtime
+	 * Service with one or more HttpService services.
 	 * 
 	 * <p>
 	 * If this Http Whiteboard implementation also implements the Http Service
-	 * Specification this property is set to a collection of {@code service.id}
-	 * for the {@code HttpService} registrations provided by this
-	 * implementation.
+	 * Specification, this service property is set to a collection of
+	 * {@code service.id} for the {@code HttpService} services registered by
+	 * this implementation.
 	 * 
 	 * <p>
-	 * The value of this attribute must be of type {@code Collection<Long>}.
+	 * The value of this service property must be of type
+	 * {@code Collection<Long>}.
 	 */
-	public static final String	HTTP_SERVICE_ID_ATTRIBUTE		= "osgi.http.service.id";
+	public static final String	HTTP_SERVICE_ID		= "osgi.http.service.id";
 }
diff --git a/http/api/src/main/java/org/osgi/service/http/runtime/dto/DTOConstants.java b/http/api/src/main/java/org/osgi/service/http/runtime/dto/DTOConstants.java
index 6994275..52e5fed 100644
--- a/http/api/src/main/java/org/osgi/service/http/runtime/dto/DTOConstants.java
+++ b/http/api/src/main/java/org/osgi/service/http/runtime/dto/DTOConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2012, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,65 +25,52 @@
 	}
 
 	/**
-	 * Failure reason is unknown
-	 * <p>
-	 * The value of {@code FAILURE_REASON_UNKNOWN} is 0.
+	 * Failure reason is unknown.
 	 */
-	public static final int	FAILURE_REASON_UNKNOWN		= 0;
+	public static final int	FAILURE_REASON_UNKNOWN						= 0;
 
 	/**
 	 * No matching {@code ServletContextHelper}.
-	 * <p>
-	 * The value of {@code FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING} is 1.
 	 **/
 	public static final int	FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING	= 1;
 
 	/**
 	 * Matching {@code ServletContextHelper}, but the context is not used due to
 	 * a problem with the context.
-	 * <p>
-	 * The value of {@code FAILURE_REASON_SERVLET_CONTEXT_FAILURE} is 2.
 	 */
 	public static final int	FAILURE_REASON_SERVLET_CONTEXT_FAILURE		= 2;
 
 	/**
-	 * Service is shadowed by another service, e.g. a service with the same
-	 * registration properties but a higher service ranking.
+	 * Service is shadowed by another service.
 	 * <p>
-	 * The value of {@code FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE} is 3.
+	 * For example, a service with the same service properties but a higher
+	 * service ranking.
 	 */
 	public static final int	FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE	= 3;
 
 	/**
-	 * An exception occurred during initializing of the service. This reason can
-	 * only happen for servlets and servlet filters.
+	 * An exception occurred during initializing of the service.
 	 * <p>
-	 * The value of {@code FAILURE_REASON_EXCEPTION_ON_INIT} is 4.
+	 * This reason can only happen for servlets and servlet filters.
 	 */
 	public static final int	FAILURE_REASON_EXCEPTION_ON_INIT			= 4;
 
 	/**
 	 * The service is registered in the service registry but getting the service
 	 * fails as it returns {@code null}.
-	 * <p>
-	 * The value of {@code FAILURE_REASON_SERVICE_NOT_GETTABLE} is 5.
 	 */
 	public static final int	FAILURE_REASON_SERVICE_NOT_GETTABLE			= 5;
 
 	/**
-	 * The service is registered in the service registry but the provided
-	 * registration properties are invalid.
-	 * <p>
-	 * The value of {@code FAILURE_REASON_VALIDATION_FAILED} is 6.
+	 * The service is registered in the service registry but the service
+	 * properties are invalid.
 	 */
 	public static final int	FAILURE_REASON_VALIDATION_FAILED			= 6;
 
 	/**
 	 * The service is not registered as a prototype scoped service and is
-	 * already used with one servlet context and therefore can't be used with
+	 * already in use with a servlet context and therefore can't be used with
 	 * another servlet context.
-	 * <p>
-	 * The value of {@code FAILURE_REASON_SERVICE_ALREAY_USED} is 7.
 	 */
-	public static final int	FAILURE_REASON_SERVICE_ALREAY_USED			= 7;
+	public static final int	FAILURE_REASON_SERVICE_IN_USE				= 7;
 }
diff --git a/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java b/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
index 9be72ae..51af195 100644
--- a/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
+++ b/http/api/src/main/java/org/osgi/service/http/runtime/dto/ServletContextDTO.java
@@ -1,6 +1,6 @@
 /*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
- *
+ * Copyright (c) OSGi Alliance (2012, 2015). All Rights Reserved.
+ * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -17,7 +17,6 @@
 package org.osgi.service.http.runtime.dto;
 
 import java.util.Map;
-
 import org.osgi.dto.DTO;
 
 /**
@@ -25,22 +24,24 @@
  * resources, servlet Filters, and listeners associated with that servlet
  * context. The Servlet Context is usually backed by a
  * {@link org.osgi.service.http.context.ServletContextHelper} service.
- *
+ * 
  * @NotThreadSafe
  * @author $Id$
  */
 public class ServletContextDTO extends DTO {
 	/**
 	 * The name of the servlet context.
-	 *
 	 * The name of the corresponding
 	 * {@link org.osgi.service.http.context.ServletContextHelper}.
+	 * <p>
+	 * This is the value returned by the
+	 * {@code ServletContext.getServletContextName()} method.
 	 */
-	public String				name;
+	public String name;
 
 	/**
 	 * The servlet context path.
-	 *
+	 * 
 	 * This is the value returned by the {@code ServletContext.getContextPath()}
 	 * method.
 	 */
@@ -56,7 +57,7 @@
 
 	/**
 	 * The servlet context attributes.
-	 *
+	 * 
 	 * <p>
 	 * The value type must be a numerical type, {@code Boolean}, {@code String},
 	 * {@code DTO} or an array of any of the former. Therefore this method will
@@ -80,7 +81,7 @@
 	/**
 	 * Returns the representations of the {@code Servlet} services associated
 	 * with this context.
-	 *
+	 * 
 	 * The representations of the {@code Servlet} services associated with this
 	 * context. The returned array may be empty if this context is currently not
 	 * associated with any {@code Servlet} services.
@@ -90,7 +91,7 @@
 	/**
 	 * Returns the representations of the resource services associated with this
 	 * context.
-	 *
+	 * 
 	 * The representations of the resource services associated with this
 	 * context. The returned array may be empty if this context is currently not
 	 * associated with any resource services.
@@ -100,7 +101,7 @@
 	/**
 	 * Returns the representations of the servlet {@code Filter} services
 	 * associated with this context.
-	 *
+	 * 
 	 * The representations of the servlet {@code Filter} services associated
 	 * with this context. The returned array may be empty if this context is
 	 * currently not associated with any servlet {@code Filter} services.
@@ -110,7 +111,7 @@
 	/**
 	 * Returns the representations of the error page {@code Servlet} services
 	 * associated with this context.
-	 *
+	 * 
 	 * The representations of the error page {@code Servlet} services associated
 	 * with this context. The returned array may be empty if this context is
 	 * currently not associated with any error pages.
@@ -120,7 +121,7 @@
 	/**
 	 * Returns the representations of the listener services associated with this
 	 * context.
-	 *
+	 * 
 	 * The representations of the listener services associated with this
 	 * context. The returned array may be empty if this context is currently not
 	 * associated with any listener services.
diff --git a/http/api/src/main/java/org/osgi/service/http/runtime/dto/package-info.java b/http/api/src/main/java/org/osgi/service/http/runtime/dto/package-info.java
index 77c57c1..f1721da 100644
--- a/http/api/src/main/java/org/osgi/service/http/runtime/dto/package-info.java
+++ b/http/api/src/main/java/org/osgi/service/http/runtime/dto/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
  */
 
 /**
- * Http Service Runtime DTO Package Version 1.0.
+ * Http Runtime DTO Package Version 1.0.
  * 
  * <p>
  * Bundles wishing to use this package must list the package in the
diff --git a/http/api/src/main/java/org/osgi/service/http/runtime/package-info.java b/http/api/src/main/java/org/osgi/service/http/runtime/package-info.java
index 80f86d1..77af772 100644
--- a/http/api/src/main/java/org/osgi/service/http/runtime/package-info.java
+++ b/http/api/src/main/java/org/osgi/service/http/runtime/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
  */
 
 /**
- * Http Service Runtime Package Version 1.0.
+ * Http Runtime Package Version 1.0.
  * 
  * <p>
  * Bundles wishing to use this package must list the package in the
diff --git a/http/api/src/main/java/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java b/http/api/src/main/java/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java
index 2c9b7de..e92aca8 100644
--- a/http/api/src/main/java/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java
+++ b/http/api/src/main/java/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2012, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2012, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@
 import org.osgi.service.http.runtime.HttpServiceRuntimeConstants;
 
 /**
- * Defines standard constants for the whiteboard services.
+ * Defines standard constants for the Http Whiteboard services.
  * 
  * @author $Id$
  */
@@ -54,7 +54,7 @@
 	 * @see #HTTP_WHITEBOARD_CONTEXT_SELECT
 	 * @see #HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME
 	 */
-	public static final String	HTTP_WHITEBOARD_CONTEXT_NAME			= "osgi.http.whiteboard.context.name";
+	public static final String	HTTP_WHITEBOARD_CONTEXT_NAME				= "osgi.http.whiteboard.context.name";
 
 	/**
 	 * The name of the default {@link ServletContextHelper}. If a service is
@@ -63,7 +63,7 @@
 	 * 
 	 * @see #HTTP_WHITEBOARD_CONTEXT_NAME
 	 */
-	public static final String	HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME	= "default";
+	public static final String	HTTP_WHITEBOARD_DEFAULT_CONTEXT_NAME		= "default";
 
 	/**
 	 * Service property specifying the path of an {@link ServletContextHelper}
@@ -88,7 +88,7 @@
 	 * @see #HTTP_WHITEBOARD_CONTEXT_NAME
 	 * @see #HTTP_WHITEBOARD_CONTEXT_SELECT
 	 */
-	public static final String	HTTP_WHITEBOARD_CONTEXT_PATH			= "osgi.http.whiteboard.context.path";
+	public static final String	HTTP_WHITEBOARD_CONTEXT_PATH				= "osgi.http.whiteboard.context.path";
 
 	/**
 	 * Service property prefix referencing a {@link ServletContextHelper}
@@ -132,7 +132,7 @@
 	 * @see #HTTP_WHITEBOARD_CONTEXT_NAME
 	 * @see #HTTP_WHITEBOARD_CONTEXT_PATH
 	 */
-	public static final String	HTTP_WHITEBOARD_CONTEXT_SELECT			= "osgi.http.whiteboard.context.select";
+	public static final String	HTTP_WHITEBOARD_CONTEXT_SELECT				= "osgi.http.whiteboard.context.select";
 
 	/**
 	 * Service property specifying the servlet name of a {@code Servlet}
@@ -155,7 +155,7 @@
 	 * <p>
 	 * The value of this service property must be of type {@code String}.
 	 */
-	public static final String	HTTP_WHITEBOARD_SERVLET_NAME			= "osgi.http.whiteboard.servlet.name";
+	public static final String	HTTP_WHITEBOARD_SERVLET_NAME				= "osgi.http.whiteboard.servlet.name";
 
 	/**
 	 * Service property specifying the request mappings for a {@code Servlet}
@@ -172,7 +172,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings"
 	 */
-	public static final String	HTTP_WHITEBOARD_SERVLET_PATTERN			= "osgi.http.whiteboard.servlet.pattern";
+	public static final String	HTTP_WHITEBOARD_SERVLET_PATTERN				= "osgi.http.whiteboard.servlet.pattern";
 
 	/**
 	 * Service property specifying whether a {@code Servlet} service acts as an
@@ -181,8 +181,8 @@
 	 * <p>
 	 * The service property values may be the name of a fully qualified
 	 * exception class, a three digit HTTP status code, the value "4xx" for all
-	 * error codes in the 400 rage, or the value "5xx" for all error codes in
-	 * the 500 rage. Any value that is not a three digit number, or one of the
+	 * error codes in the 400 range, or the value "5xx" for all error codes in
+	 * the 500 range. Any value that is not a three digit number, or one of the
 	 * two special values is considered to be the name of a fully qualified
 	 * exception class.
 	 * 
@@ -190,7 +190,7 @@
 	 * The value of this service property must be of type {@code String},
 	 * {@code String[]}, or {@code Collection<String>}.
 	 */
-	public static final String	HTTP_WHITEBOARD_SERVLET_ERROR_PAGE		= "osgi.http.whiteboard.servlet.errorPage";
+	public static final String	HTTP_WHITEBOARD_SERVLET_ERROR_PAGE			= "osgi.http.whiteboard.servlet.errorPage";
 
 	/**
 	 * Service property specifying whether a {@code Servlet} service supports
@@ -204,7 +204,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 2.3.3.3 Asynchronous Processing"
 	 */
-	public static final String	HTTP_WHITEBOARD_SERVLET_ASYNC_SUPPORTED	= "osgi.http.whiteboard.servlet.asyncSupported";
+	public static final String	HTTP_WHITEBOARD_SERVLET_ASYNC_SUPPORTED		= "osgi.http.whiteboard.servlet.asyncSupported";
 
 	/**
 	 * Service property prefix referencing a {@link Servlet} service.
@@ -242,7 +242,7 @@
 	 * <p>
 	 * The value of this service property must be of type {@code String}.
 	 */
-	public static final String	HTTP_WHITEBOARD_FILTER_NAME				= "osgi.http.whiteboard.filter.name";
+	public static final String	HTTP_WHITEBOARD_FILTER_NAME					= "osgi.http.whiteboard.filter.name";
 
 	/**
 	 * Service property specifying the request mappings for a {@code Filter}
@@ -260,7 +260,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings"
 	 */
-	public static final String	HTTP_WHITEBOARD_FILTER_PATTERN			= "osgi.http.whiteboard.filter.pattern";
+	public static final String	HTTP_WHITEBOARD_FILTER_PATTERN				= "osgi.http.whiteboard.filter.pattern";
 
 	/**
 	 * Service property specifying the {@link #HTTP_WHITEBOARD_SERVLET_NAME
@@ -270,13 +270,13 @@
 	 * The specified names are used to determine the servlets whose requests
 	 * should be mapped to the servlet filter. Servlet filter services without
 	 * this service property or the {@link #HTTP_WHITEBOARD_FILTER_PATTERN} or
-	 * the {@link #HTTP_WHITEBOARD_FILTER_REGEX} service propertyare ignored.
+	 * the {@link #HTTP_WHITEBOARD_FILTER_REGEX} service property are ignored.
 	 * 
 	 * <p>
 	 * The value of this service property must be of type {@code String},
 	 * {@code String[]}, or {@code Collection<String>}.
 	 */
-	public static final String	HTTP_WHITEBOARD_FILTER_SERVLET			= "osgi.http.whiteboard.filter.servlet";
+	public static final String	HTTP_WHITEBOARD_FILTER_SERVLET				= "osgi.http.whiteboard.filter.servlet";
 
 	/**
 	 * Service property specifying the request mappings for a servlet
@@ -296,7 +296,7 @@
 	 * 
 	 * @see "java.util.regex.Pattern"
 	 */
-	public static final String	HTTP_WHITEBOARD_FILTER_REGEX			= "osgi.http.whiteboard.filter.regex";
+	public static final String	HTTP_WHITEBOARD_FILTER_REGEX				= "osgi.http.whiteboard.filter.regex";
 
 	/**
 	 * Service property specifying whether a servlet {@code Filter} service
@@ -311,7 +311,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 2.3.3.3 Asynchronous Processing"
 	 */
-	public static final String	HTTP_WHITEBOARD_FILTER_ASYNC_SUPPORTED	= "osgi.http.whiteboard.filter.asyncSupported";
+	public static final String	HTTP_WHITEBOARD_FILTER_ASYNC_SUPPORTED		= "osgi.http.whiteboard.filter.asyncSupported";
 
 	/**
 	 * Service property specifying the dispatcher handling of a servlet
@@ -330,7 +330,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
 	 */
-	public static final String	HTTP_WHITEBOARD_FILTER_DISPATCHER		= "osgi.http.whiteboard.filter.dispatcher";
+	public static final String	HTTP_WHITEBOARD_FILTER_DISPATCHER			= "osgi.http.whiteboard.filter.dispatcher";
 
 	/**
 	 * Service property prefix referencing a {@link Filter} service.
@@ -369,7 +369,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
 	 */
-	public static final String	DISPATCHER_REQUEST						= "REQUEST";
+	public static final String	DISPATCHER_REQUEST							= "REQUEST";
 
 	/**
 	 * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
@@ -378,7 +378,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
 	 */
-	public static final String	DISPATCHER_INCLUDE						= "INCLUDE";
+	public static final String	DISPATCHER_INCLUDE							= "INCLUDE";
 
 	/**
 	 * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
@@ -387,7 +387,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
 	 */
-	public static final String	DISPATCHER_FORWARD						= "FORWARD";
+	public static final String	DISPATCHER_FORWARD							= "FORWARD";
 
 	/**
 	 * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
@@ -396,7 +396,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
 	 */
-	public static final String	DISPATCHER_ASYNC						= "ASYNC";
+	public static final String	DISPATCHER_ASYNC							= "ASYNC";
 
 	/**
 	 * Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
@@ -405,7 +405,7 @@
 	 * 
 	 * @see "Java Servlet Specification Version 3.0, Section 6.2.5 Filters and the RequestDispatcher"
 	 */
-	public static final String	DISPATCHER_ERROR						= "ERROR";
+	public static final String	DISPATCHER_ERROR							= "ERROR";
 
 	/**
 	 * Service property specifying the request mappings for resources.
@@ -422,7 +422,7 @@
 	 * @see "Java Servlet Specification Version 3.0, Section 12.2 Specification of Mappings"
 	 * @see #HTTP_WHITEBOARD_RESOURCE_PREFIX
 	 */
-	public static final String	HTTP_WHITEBOARD_RESOURCE_PATTERN		= "osgi.http.whiteboard.resource.pattern";
+	public static final String	HTTP_WHITEBOARD_RESOURCE_PATTERN			= "osgi.http.whiteboard.resource.pattern";
 
 	/**
 	 * Service property specifying the resource entry prefix for a resource
@@ -444,26 +444,27 @@
 	 * 
 	 * @see #HTTP_WHITEBOARD_RESOURCE_PATTERN
 	 */
-	public static final String	HTTP_WHITEBOARD_RESOURCE_PREFIX			= "osgi.http.whiteboard.resource.prefix";
+	public static final String	HTTP_WHITEBOARD_RESOURCE_PREFIX				= "osgi.http.whiteboard.resource.prefix";
 
 	/**
 	 * Service property specifying the target filter to select the Http
-	 * Whiteboard Implementation to process the service.
+	 * Whiteboard implementation to process the service.
 	 * 
 	 * <p>
-	 * An Http Whiteboard Implementation can define any number of attributes
-	 * which can be referenced by the target filter. The attributes should
-	 * always include the
-	 * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT_ATTRIBUTE
-	 * osgi.http.endpoint} attribute if the endpoint information is known.
+	 * An Http Whiteboard implementation can define any number of service
+	 * properties which can be referenced by the target filter. The service
+	 * properties should always include the
+	 * {@link HttpServiceRuntimeConstants#HTTP_SERVICE_ENDPOINT
+	 * osgi.http.endpoint} service property if the endpoint information is
+	 * known.
 	 * 
 	 * <p>
 	 * If this service property is not specified, then all Http Whiteboard
-	 * Implementations can process the service.
+	 * implementations can process the service.
 	 * 
 	 * <p>
 	 * The value of this service property must be of type {@code String} and be
 	 * a valid {@link Filter filter string}.
 	 */
-	public static final String	HTTP_WHITEBOARD_TARGET					= "osgi.http.whiteboard.target";
+	public static final String	HTTP_WHITEBOARD_TARGET						= "osgi.http.whiteboard.target";
 }
diff --git a/http/api/src/main/java/org/osgi/service/http/whiteboard/package-info.java b/http/api/src/main/java/org/osgi/service/http/whiteboard/package-info.java
index ed71ba3..033e5c0 100644
--- a/http/api/src/main/java/org/osgi/service/http/whiteboard/package-info.java
+++ b/http/api/src/main/java/org/osgi/service/http/whiteboard/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2015). All Rights Reserved.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
  */
 
 /**
- * Http Service Whiteboard Package Version 1.0.
+ * Http Whiteboard Package Version 1.0.
  * 
  * <p>
  * Bundles wishing to use this package must list the package in the