Interface HttpContextMapping
-
- All Superinterfaces:
ContextMapping
public interface HttpContextMapping extends ContextMapping
HttpContext mapping collects all the information required to register a
HttpContextto allow referencing it later.Registering a
HttpContextcan be done in two ways:- registering a service with this interface - all the information is included in service itself (explicit whiteboard approach)
- registering a
HttpContextservice, while required properties (mapping, name, parameters) are specified using service registration properties (legacy Pax Web Whiteboard approach)This interface doesn't extend
ContextRelated, because it represents the context itself.Even if
getHttpContext()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.- Since:
- 0.4.0, March 16, 2008
- Author:
- Alin Dreghiciu, Grzegorz Grzybek
-
-
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.HttpContextgetHttpContext()Get actual context being registered.default org.osgi.service.http.HttpContextgetHttpContext(org.osgi.framework.Bundle bundle)Get actual context being registered.booleanisShared()Whether the context should be shared - Whiteboard contexts are always shared, but Http Service doesn't define such flag at all.-
Methods inherited from interface org.ops4j.pax.web.service.whiteboard.ContextMapping
getConnectors, getContextId, getContextPath, getInitParameters, getVirtualHosts
-
-
-
-
Method Detail
-
getHttpContext
org.osgi.service.http.HttpContext getHttpContext()
Get actual context being registered. If specified, this is the way to provide the behavioral aspects of the context (e.g.,
HttpContext.handleSecurity(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)). If not specified, defaultHttpContextwill be created according toContextMapping.getContextId().- Returns:
- associated HttpContext; can be null, case when a default http context will be created and used
-
getHttpContext
default org.osgi.service.http.HttpContext getHttpContext(org.osgi.framework.Bundle bundle)
Get actual context being registered. This version accepts
Bundleargument to reflect recommendations from Whiteboard Service specification, whereServletContextHelperis suggested to be registered asServiceFactory.- Parameters:
bundle-- Returns:
-
isShared
boolean isShared()
Whether the context should be shared - Whiteboard contexts are always shared, but Http Service doesn't define such flag at all.- Returns:
-
-