Interface ServletContextHelperMapping

  • All Superinterfaces:
    ContextMapping

    public interface ServletContextHelperMapping
    extends ContextMapping

    ServletContextHelper mapping collects all the information required to register a ServletContextHelper to allow referencing it later. This is actually not recommended Whiteboard service, because OSGi CMPN Whiteboard specification mentions registrations of ServletContextHelper services directly, with supporting service registration parameters, which is the OSGi way.

    Registering a ServletContextHelper can be done in two ways:

    • registering a service with this interface - all the information is included in service itself (explicit whiteboard approach)
    • registering a ServletContextHelper service, while required properties (mapping, name, parameters) are specified using service registration properties/annotations (OSGi CMPN Whiteboard approach)

    This interface doesn't extend ContextRelated, because it represents the context itself.

    Even if getServletContextHelper() may return a singleton or a new instance on each call, this method will be called once and the result will be treated as singleton.

    • Method Detail

      • getServletContextHelper

        org.osgi.service.http.context.ServletContextHelper getServletContextHelper()

        Get actual context help being registered. If specified, this is the way to provide the behavioral aspects of the context (e.g., ServletContextHelper.handleSecurity(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)). If not specified, default ServletContextHelper will be created according to ContextMapping.getContextId().

        Returns:
      • getServletContextHelper

        default org.osgi.service.http.context.ServletContextHelper getServletContextHelper​(org.osgi.framework.Bundle bundle)

        Get actual context help being registered. This version accepts Bundle, so it's possible to return ServletContextHelper tied to given bundle. By default, Bundle argument is ignored and getServletContextHelper() is called.

        This method reflects Whiteboard Service specification, where ServletContextHelper is recommended to be registered as ServiceFactory.

        Returns: