Spec-Zone .ru
спецификации, руководства, описания, API
Please note that the specifications and other information contained herein are not final and are subject to change. The information is being made available to you solely for purpose of evaluation.

Java™ Platform
Standard Ed. 7

DRAFT ea-b118

javax.xml.ws.spi.http
Class HttpContext

java.lang.Object
  extended by javax.xml.ws.spi.http.HttpContext

public abstract class HttpContext
extends Object

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:
JAX-WS 2.2

Field Summary
Modifier and Type Field and Description
protected  HttpHandler handler
           
 
Constructor Summary
Constructor and Description
HttpContext()
           
 
Method Summary
Modifier and Type Method and Description
abstract  Object getAttribute(String name)
          Returns an attribute value for container's configuration and other data that can be used by jax-ws runtime.
abstract  Set<String> getAttributeNames()
          Returns all attribute names for container's configuration and other data that can be used by jax-ws runtime.
abstract  String getPath()
          Returns the path for this context.
 void setHandler(HttpHandler handler)
          JAX-WS runtime sets its handler during Endpoint.publish(HttpContext) to handle HTTP requests for this context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handler

protected HttpHandler handler
Constructor Detail

HttpContext

public HttpContext()
Method Detail

setHandler

public void setHandler(HttpHandler handler)
JAX-WS runtime sets its handler during Endpoint.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

public abstract String 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

public abstract Object getAttribute(String name)
Returns an attribute value for container's configuration and other data that can be used by jax-ws runtime.

Parameters:
name - attribute name
Returns:
attribute value

getAttributeNames

public abstract Set<String> getAttributeNames()
Returns all attribute names for container's configuration and other data that can be used by jax-ws runtime.

Returns:
set of all attribute names

Java™ Platform
Standard Ed. 7

DRAFT ea-b118

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Copyright © 1993, 2010, Oracle Corporation. All rights reserved.
DRAFT ea-b118

Scripting on this page tracks web page traffic, but does not change the content in any way.