Interface ServletContextHelperMapping
-
- All Superinterfaces:
ContextMapping
public interface ServletContextHelperMapping extends ContextMapping
ServletContextHelper mapping collects all the information required to register a
ServletContextHelperto allow referencing it later. This is actually not recommended Whiteboard service, because OSGi CMPN Whiteboard specification mentions registrations ofServletContextHelperservices directly, with supporting service registration parameters, which is the OSGi way.Registering a
ServletContextHelpercan be done in two ways:- registering a service with this interface - all the information is included in service itself (explicit whiteboard approach)
- registering a
ServletContextHelperservice, 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.ServletContextHelpergetServletContextHelper()Get actual context help being registered.default org.osgi.service.http.context.ServletContextHelpergetServletContextHelper(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, defaultServletContextHelperwill 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 returnServletContextHelpertied to given bundle. By default,Bundleargument is ignored andgetServletContextHelper()is called.This method reflects Whiteboard Service specification, where
ServletContextHelperis recommended to be registered asServiceFactory.- Returns:
-
-