HTTP Whiteboard and selection of the ServletContextHelper

Description

The current implementation of the property "osgi.http.whiteboard.context.select" is not compliant to the R6 Whiteboard specification.

This property is an osgi filter which can match any property of a ServletContextHelper. Moreover, this filter can match multiple ServletContextHelper : In this case, for each ServletContextHelper, the Whiteboard element is instanciated (through ServiceObject) and added to corresponding ServletContext.

From the specification :

140.3 Common Whiteboard Properties

osgi.http.whiteboard.context.select (optional) :
An LDAP-style filter to select the associated ServletContextHelper service to use. Any service property of the Servlet Context Helper can be filtered on. If this property is missing the default Servlet Context Helper is used.

For example, to select a Servlet Context Helper with name myCTX provide the following value:
(osgi.http.whiteboard.context.name=myCTX)

To select all Servlet Context Helpers provide the following value:
(osgi.http.whiteboard.context.name=*)
If no matching context exists this is reflected in the failure DTOs. See HTTP_WHITEBOARD_CONTEXT_SELECT

...

If multiple Servlet Context Helper services match the osgi.http.whiteboard.context.select property the servlet, filter, resource or listener will be registered with all these Servlet Context Helpers.
To avoid multiple init() and destroy() calls on the same instance, servlets and filters should be registered as Prototype Service Factory.

Environment

None

Status

Assignee

Grzegorz Grzybek

Reporter

J Brébec

Labels

None

Components

Fix versions

Affects versions

6.0.6

Priority

Major
Configure