Package jakarta.xml.ws.spi.http
Class HttpContext
java.lang.Object
jakarta.xml.ws.spi.http.HttpContext
HttpContext represents a mapping between the root URI path of a web
service to a
HttpHandler
which is invoked to handle requests
destined for that path on the associated container.
Container provides the implementation for this and it matches web service requests to corresponding HttpContext objects.
- Since:
- 1.7, JAX-WS 2.2
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Object
getAttribute
(String name) Returns an attribute value for container's configuration and other data that can be used by Jakarta XML Web Services runtime.Returns all attribute names for container's configuration and other data that can be used by Jakarta XML Web Services runtime.abstract String
getPath()
Returns the path for this context.void
setHandler
(HttpHandler handler) Jakarta XML Web Services runtime sets its handler duringEndpoint.publish(HttpContext)
to handle HTTP requests for this context.
-
Field Details
-
handler
The handler to set for this context.
-
-
Constructor Details
-
HttpContext
public HttpContext()
-
-
Method Details
-
setHandler
Jakarta XML Web Services runtime sets its handler duringEndpoint.publish(HttpContext)
to handle HTTP requests for this context. Container or its extensions use this handler to process the requests.- Parameters:
handler
- the handler to set for this context
-
getPath
Returns the path for this context. This path uniquely identifies an endpoint inside an application and the path is relative to application's context path. Container should give this path based on how it matches request URIs to this HttpContext object.For servlet container, this is typically a url-pattern for an endpoint.
Endpoint's address for this context can be computed as follows:
HttpExchange exch = ...; String endpointAddress = exch.getScheme() + "://" + exch.getLocalAddress().getHostName() + ":" + exch.getLocalAddress().getPort() + exch.getContextPath() + getPath();
- Returns:
- this context's path
-
getAttribute
Returns an attribute value for container's configuration and other data that can be used by Jakarta XML Web Services runtime.- Parameters:
name
- attribute name- Returns:
- attribute value
-
getAttributeNames
Returns all attribute names for container's configuration and other data that can be used by Jakarta XML Web Services runtime.- Returns:
- set of all attribute names
-