Update to latest http whiteboard api
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1659002 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 08c4a0d..a75d2d0 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
@@ -1,5 +1,5 @@
/*
- * Copyright (c) OSGi Alliance (2000, 2014). All Rights Reserved.
+ * Copyright (c) OSGi Alliance (2000, 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,6 +25,7 @@
import javax.servlet.http.HttpServletResponse;
import org.osgi.annotation.versioning.ConsumerType;
import org.osgi.framework.Bundle;
+import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
/**
* Helper service for a servlet context used by a Http Whiteboard implementation
@@ -36,32 +37,33 @@
*
* <p>
* Each {@code ServletContextHelper} is registered with a
- * {@link org.osgi.service.http.whiteboard.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 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 org.osgi.service.http.whiteboard.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 org.osgi.framework.ServiceReference#compareTo(Object)} until a matching servlet or
- * resource is found.
+ * {@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 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 org.osgi.service.http.whiteboard.HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
- * associated} with a {@code ServletContextHelper} service. If the referenced
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT associated}
+ * with a {@code ServletContextHelper} service. 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.
*
* <p>
* If no {@code ServletContextHelper} service is associated, that is no
- * {@link org.osgi.service.http.whiteboard.HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
+ * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT
* HTTP_WHITEBOARD_CONTEXT_SELECT} is configured for a whiteboard service, a
* default {@code ServletContextHelper} is used.
*
@@ -80,10 +82,10 @@
* <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. 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
+ * 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>{@code getResourcePaths} - Assumes that the resources are in the bundle
* of the whiteboard service. This method calls {@code Bundle.findEntries}
@@ -95,8 +97,8 @@
*
* @ThreadSafe
* @author $Id$
- * @see org.osgi.service.http.whiteboard.HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME
- * @see org.osgi.service.http.whiteboard.HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH
+ * @see HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME
+ * @see HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH
*/
@ConsumerType
public abstract class ServletContextHelper {
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 45dda1c..2c9b7de 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
@@ -349,6 +349,21 @@
public static final String HTTP_WHITEBOARD_FILTER_INIT_PARAM_PREFIX = "filter.init.";
/**
+ * Service property to mark a Listener service as a Whiteboard service.
+ * Listener services with this property set to the string value "true" will
+ * be treated as Whiteboard services opting in to being handled by the Http
+ * Whiteboard implementation. If the value "false" is specified, the service
+ * is opting out and this case is treated exactly the same as if this
+ * property is missing. If an invalid value is specified this is treated as
+ * a failure.
+ *
+ * <p>
+ * The value of this service property must be of type {@code String}. Valid
+ * values are "true" and "false" ignoring case.
+ */
+ public static final String HTTP_WHITEBOARD_LISTENER = "osgi.http.whiteboard.listener";
+
+ /**
* Possible value for the {@link #HTTP_WHITEBOARD_FILTER_DISPATCHER}
* property indicating the servlet filter is applied to client requests.
*