Bug 436698 - [http] [RFC 189] Implement the proposed R6 Http Whiteboard Service
 - update the OSGi API to the latest
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java
index acf7282..5b46122 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpContext.java
@@ -20,7 +20,6 @@
 import java.net.URL;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import org.osgi.annotation.versioning.ConsumerType;
 
 /**
  * Context for HTTP Requests.
@@ -53,10 +52,8 @@
  * </ul>
  * 
  * 
- * @ThreadSafe
  * @author $Id$
  */
-@ConsumerType
 public interface HttpContext {
 	/**
 	 * {@code HttpServletRequest} attribute specifying the name of the
@@ -151,17 +148,17 @@
 	 * <p>
 	 * Called by the Http Service to map a resource name to a URL. For servlet
 	 * registrations, Http Service will call this method to support the
-	 * <code>ServletContext</code> methods <code>getResource</code> and
-	 * <code>getResourceAsStream</code>. For resource registrations, Http
-	 * Service will call this method to locate the named resource. The context
-	 * can control from where resources come. For example, the resource can be
+	 * {@code ServletContext} methods {@code getResource} and
+	 * {@code getResourceAsStream}. For resource registrations, Http Service
+	 * will call this method to locate the named resource. 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()</code> or to a resource in
-	 * the context's bundle via <code>getClass().getResource(name)</code>
+	 * {@code bundleContext.getDataFile(name).toURL()} or to a resource in the
+	 * context's bundle via {@code getClass().getResource(name)}
 	 * 
 	 * @param name the name of the requested resource
 	 * @return URL that Http Service can use to read the resource or
-	 *         <code>null</code> if the resource does not exist.
+	 *         {@code null} if the resource does not exist.
 	 */
 	public URL getResource(String name);
 
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java
index fd0cd03..c7dcd58 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/HttpService.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2000, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2013). 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.
@@ -19,18 +19,16 @@
 import java.util.Dictionary;
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
-import org.osgi.annotation.versioning.ProviderType;
 
 /**
  * The Http Service allows other bundles in the OSGi environment to dynamically
  * register resources and servlets into the URI namespace of Http Service. A
  * bundle may later unregister its resources or servlets.
  * 
- * @ThreadSafe
+ * @noimplement
  * @author $Id$
  * @see HttpContext
  */
-@ProviderType
 public interface HttpService {
 	/**
 	 * Registers a servlet into the URI namespace.
@@ -78,7 +76,7 @@
 	 * @throws java.lang.IllegalArgumentException if any of the arguments are
 	 *         invalid
 	 */
-	public void registerServlet(String alias, Servlet servlet, Dictionary<String, String> initparams, HttpContext context) throws ServletException, NamespaceException;
+	public void registerServlet(String alias, Servlet servlet, Dictionary initparams, HttpContext context) throws ServletException, NamespaceException;
 
 	/**
 	 * Registers resources into the URI namespace.
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java
index bfc8f83..6e4d8f6 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/NamespaceException.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2000, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 2013). 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.
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java
index 0052bc2..ecd33a7 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelper.java
@@ -175,7 +175,6 @@
 	 * {@code getAuthType} and {@code getRemoteUser} methods, respectively, on
 	 * the request.
 	 * 
-	 * @param context The servlet context helper context for this call.
 	 * @param request The HTTP request.
 	 * @param response The HTTP response.
 	 * @return {@code true} if the request should be serviced, {@code false} if
@@ -185,14 +184,9 @@
 	 *         the Http Whiteboard Service will terminate the request and close
 	 *         the socket.
 	 */
-	public boolean handleSecurity(final ServletContextHelperContext context,
-			                      final HttpServletRequest request, 
+	public boolean handleSecurity(final HttpServletRequest request,
 			                      final HttpServletResponse response)
 			throws IOException {
-		final ServletContextHelper parent = context.getParentContext(this);
-		if ( parent != null ) {
-			return parent.handleSecurity(context, request, response);
-		}
 		return true;
 	}
 
@@ -212,12 +206,11 @@
 	 * via {@code bundleContext.getDataFile(name).toURL()} or to a resource in
 	 * the context's bundle via {@code getClass().getResource(name)}
 	 * 
-	 * @param context The servlet context helper context for this call.
 	 * @param name The name of the requested resource.
 	 * @return A URL that Http Whiteboard Service can use to read the resource
 	 *         or {@code null} if the resource does not exist.
 	 */
-	public URL getResource(final ServletContextHelperContext context, String name) {
+	public URL getResource(String name) {
 		final Bundle localBundle = this.bundle;
 		if (name != null && localBundle != null) {
 			if (name.startsWith("/")) {
@@ -240,17 +233,12 @@
 	 * will call this method to determine the MIME type for the
 	 * {@code Content-Type} header in the response.
 	 *
-	 * @param context The servlet context helper context for this call.
 	 * @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.
 	 */
-	public String getMimeType(final ServletContextHelperContext context, final String name) {
-		final ServletContextHelper parent = context.getParentContext(this);
-		if (parent != null) {
-			parent.getMimeType(context, name);
-		}
+	public String getMimeType(final String name) {
 		return null;
 	}
 
@@ -264,14 +252,13 @@
 	 * {@code ServletContext} method {@code getResourcePaths} for whiteboard
 	 * services.
 	 * 
-	 * @param context The servlet context helper context for this call.
 	 * @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.
 	 */
-	public Set<String> getResourcePaths(final ServletContextHelperContext context, final String 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);
@@ -294,11 +281,10 @@
 	 * {@code ServletContext} method {@code getRealPath} for whiteboard
 	 * services.
 	 * 
-	 * @param context The servlet context helper context for this call.
 	 * @param path the virtual path to be translated to a real path
 	 * @return the real path, or null if the translation cannot be performed
 	 */
-	public String getRealPath(final ServletContextHelperContext context, final String path) {
+	public String getRealPath(final String path) {
 		return null;
 	}
 }
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelperContext.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelperContext.java
deleted file mode 100644
index fe7a2ac..0000000
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/context/ServletContextHelperContext.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) OSGi Alliance (2000, 2014). 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
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.osgi.service.http.context;
-
-import org.osgi.annotation.versioning.ProviderType;
-
-/**
- * This context object is passed to each method of the
- * {@code ServletContextHelper}.
- *
- * @NotThreadSafe
- * @author $Id$
- */
-@ProviderType
-public interface ServletContextHelperContext {
-
-	/**
-	 * Return the parent context for the given {@code ServletContextHelper}
-	 * 
-	 * @param context The current {@code ServletContextHelper}
-	 * @return The parent {@code ServletContextHelper} or {@code null}
-	 */
-	ServletContextHelper getParentContext(ServletContextHelper context);
-}
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java
index 1d05501..349de70 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) OSGi Alliance (2010, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2010, 2013). 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 Package Version 1.3.
+ * Http Service Package Version 1.2.
  * 
  * <p>
  * Bundles wishing to use this package must list the package in the
@@ -26,17 +26,15 @@
  * <p>
  * Example import for consumers using the API in this package:
  * <p>
- * {@code  Import-Package: org.osgi.service.http; version="[1.2.2,2.0)"}
+ * {@code  Import-Package: org.osgi.service.http; version="[1.2,2.0)"}
  * <p>
  * Example import for providers implementing the API in this package:
  * <p>
- * {@code  Import-Package: org.osgi.service.http; version="[1.2.2,1.3)"}
+ * {@code  Import-Package: org.osgi.service.http; version="[1.2,1.3)"}
  * 
+ * @version 1.2.1
  * @author $Id$
  */
 
-@Version("1.2.2")
 package org.osgi.service.http;
 
-import org.osgi.annotation.versioning.Version;
-
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/packageinfo b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/packageinfo
index 1972757..6ebb891 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/packageinfo
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/packageinfo
@@ -1 +1 @@
-version 1.2.2
+version 1.2.1
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java
index fd445b2..8b45383 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/runtime/dto/DTOConstants.java
@@ -69,4 +69,21 @@
 	 * 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 servlet registry but the provided
+	 * registration properties are invalid.
+	 * <p>
+	 * The value of {@code FAILURE_REASON_VALIDATION_FAILED} is 6.
+	 */
+	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
+	 * 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;
 }
diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java
index 1308cfa..77173e8 100644
--- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java
+++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/http/whiteboard/HttpWhiteboardConstants.java
@@ -248,7 +248,7 @@
 	 * <p>
 	 * The specified regular expressions are used to determine whether a request
 	 * should be mapped to the servlet filter. The regular expressions must
-	 * follow the syntax defined in {@link java.util.regex.Pattern}. Filter
+	 * follow the syntax defined in {@code java.util.regex.Pattern}. Filter
 	 * services without this service property or the
 	 * {@link #HTTP_WHITEBOARD_FILTER_SERVLET} or the
 	 * {@link #HTTP_WHITEBOARD_FILTER_PATTERN} service property must be ignored.
@@ -257,7 +257,7 @@
 	 * The value of this service property must be of type {@code String},
 	 * {@code String[]}, or {@code Collection<String>}.
 	 * 
-	 * @see java.util.regex.Pattern
+	 * @see "java.util.regex.Pattern"
 	 */
 	public static final String	HTTP_WHITEBOARD_FILTER_REGEX			= "osgi.http.whiteboard.filter.regex";