From 20498a2046e9057162d528aa90e474d98b04640a Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Tue, 17 Feb 2015 15:31:58 -0600 Subject: Update the OSGi API to the latest --- .../.settings/.api_filters | 16 ++--- .../service/http/context/ServletContextHelper.java | 36 ++++++------ .../http/whiteboard/HttpWhiteboardConstants.java | 68 +++++++++++++++++++++- .../org/osgi/service/metatype/MetaTypeService.java | 18 +++++- 4 files changed, 111 insertions(+), 27 deletions(-) diff --git a/bundles/org.eclipse.osgi.services/.settings/.api_filters b/bundles/org.eclipse.osgi.services/.settings/.api_filters index 8501d69d2..9f93e63d2 100644 --- a/bundles/org.eclipse.osgi.services/.settings/.api_filters +++ b/bundles/org.eclipse.osgi.services/.settings/.api_filters @@ -47,13 +47,6 @@ - - - - - - - @@ -187,4 +180,13 @@ + + + + + + + + + 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 a6d9e57fe..a75d2d089 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 @@ -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.HttpServletRequest; 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 @@ import org.osgi.framework.Bundle; * *

* 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. * *

* 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. * *

* 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. * *

* 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. * @@ -95,8 +97,8 @@ import org.osgi.framework.Bundle; * * @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/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 8f2496a1a..2c9b7de2c 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 @@ -16,6 +16,7 @@ package org.osgi.service.http.whiteboard; +import javax.servlet.Servlet; import org.osgi.framework.Filter; import org.osgi.service.http.context.ServletContextHelper; import org.osgi.service.http.runtime.HttpServiceRuntimeConstants; @@ -89,6 +90,23 @@ public final class HttpWhiteboardConstants { */ public static final String HTTP_WHITEBOARD_CONTEXT_PATH = "osgi.http.whiteboard.context.path"; + /** + * Service property prefix referencing a {@link ServletContextHelper} + * service. + * + *

+ * For {@link ServletContextHelper} services this prefix can be used for + * service properties to mark them as initialization parameters which can be + * retrieved from the associated servlet context. The prefix is removed from + * the service property name to build the initialization parameter name. + * + *

+ * For {@link ServletContextHelper} services, the value of each + * initialization parameter service property must be of type {@code String}. + * + */ + public static final String HTTP_WHITEBOARD_CONTEXT_INIT_PARAM_PREFIX = "context.init."; + /** * Service property referencing a {@link ServletContextHelper} service. * @@ -188,6 +206,22 @@ public final class HttpWhiteboardConstants { */ public static final String HTTP_WHITEBOARD_SERVLET_ASYNC_SUPPORTED = "osgi.http.whiteboard.servlet.asyncSupported"; + /** + * Service property prefix referencing a {@link Servlet} service. + * + *

+ * For {@link Servlet} services this prefix can be used for service + * properties to mark them as initialization parameters which can be + * retrieved from the associated servlet config. The prefix is removed from + * the service property name to build the initialization parameter name. + * + *

+ * For {@link Servlet} services, the value of each initialization parameter + * service property must be of type {@code String}. + * + */ + public static final String HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX = "servlet.init."; + /** * Service property specifying the servlet filter name of a {@code Filter} * service. @@ -298,6 +332,37 @@ public final class HttpWhiteboardConstants { */ public static final String HTTP_WHITEBOARD_FILTER_DISPATCHER = "osgi.http.whiteboard.filter.dispatcher"; + /** + * Service property prefix referencing a {@link Filter} service. + * + *

+ * For {@link Filter} services this prefix can be used for service + * properties to mark them as initialization parameters which can be + * retrieved from the associated filter config. The prefix is removed from + * the service property name to build the initialization parameter name. + * + *

+ * For {@link Filter} services, the value of each initialization parameter + * service property must be of type {@code String}. + * + */ + 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. + * + *

+ * 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. @@ -375,8 +440,7 @@ public final class HttpWhiteboardConstants { * mapped. * *

- * The value of this service property must be of type {@code String}, - * {@code String[]}, or {@code Collection}. + * The value of this service property must be of type {@code String}. * * @see #HTTP_WHITEBOARD_RESOURCE_PATTERN */ diff --git a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java index ce3d84b6c..3a507c14a 100644 --- a/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java +++ b/bundles/org.eclipse.osgi.services/src/org/osgi/service/metatype/MetaTypeService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) OSGi Alliance (2005, 2013). All Rights Reserved. + * Copyright (c) OSGi Alliance (2005, 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. @@ -52,4 +52,20 @@ public interface MetaTypeService { * entry in the meta type documents directory. */ public final static String METATYPE_DOCUMENTS_LOCATION = "OSGI-INF/metatype"; + + /** + * Capability name for meta type document processors. + * + *

+ * Used in {@code Provide-Capability} and {@code Require-Capability} + * manifest headers with the {@code osgi.extender} namespace. For example: + * + *

+	 * Require-Capability: osgi.extender;
+	 *  filter:="(&(osgi.extender=osgi.metatype)(version>=1.3)(!(version>=2.0)))"
+	 * 
+ * + * @since 1.3 + */ + public static final String METATYPE_CAPABILITY_NAME = "osgi.metatype"; } -- cgit v1.2.3