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 ofServletContextHelper
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.
-
-
Field Summary
-
Fields inherited from interface org.ops4j.pax.web.service.whiteboard.ContextMapping
EMPTY_STRING_ARRAY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description org.osgi.service.http.context.ServletContextHelper
getServletContextHelper()
Get actual context help being registered.default org.osgi.service.http.context.ServletContextHelper
getServletContextHelper(org.osgi.framework.Bundle bundle)
Get actual context help being registered.-
Methods inherited from interface org.ops4j.pax.web.service.whiteboard.ContextMapping
getConnectors, getContextId, getContextPath, getInitParameters, getVirtualHosts
-
-
-
-
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, defaultServletContextHelper
will be created according toContextMapping.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 returnServletContextHelper
tied to given bundle. By default,Bundle
argument is ignored andgetServletContextHelper()
is called.This method reflects Whiteboard Service specification, where
ServletContextHelper
is recommended to be registered asServiceFactory
.- Returns:
-
-