Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java HTTP Server DRAFT ea-b118 |
||||||||
PREV CLASS NEXT CLASS |
FRAMES
|
||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.net.httpserver.HttpContext
public abstract class HttpContext extends Object
HttpContext represents a mapping between the root URI path of an application
to a HttpHandler
which is invoked to handle requests destined
for that path on the associated HttpServer or HttpsServer.
HttpContext instances are created by the create methods in HttpServer and HttpsServer
A chain of Filter
objects can be added to a HttpContext. All exchanges processed by the
context can be pre- and post-processed by each Filter in the chain.
Modifier | Constructor and Description |
---|---|
protected |
HttpContext()
|
Modifier and Type | Method and Description |
---|---|
abstract Map<String,Object> |
getAttributes()
returns a mutable Map, which can be used to pass configuration and other data to Filter modules and to the context's exchange handler. |
abstract Authenticator |
getAuthenticator()
Returns the currently set Authenticator for this context if one exists. |
abstract List<Filter> |
getFilters()
returns this context's list of Filters. |
abstract HttpHandler |
getHandler()
returns the handler for this context |
abstract String |
getPath()
returns the path this context was created with |
abstract HttpServer |
getServer()
returns the server this context was created with |
abstract Authenticator |
setAuthenticator(Authenticator auth)
Sets the Authenticator for this HttpContext. |
abstract void |
setHandler(HttpHandler h)
Sets the handler for this context, if not already set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected HttpContext()
Method Detail |
---|
public abstract HttpHandler getHandler()
public abstract void setHandler(HttpHandler h)
h
- the handler to set for this contextIllegalArgumentException
- if this context's handler is already set.NullPointerException
- if handler is null
public abstract String getPath()
public abstract HttpServer getServer()
public abstract Map<String,Object> getAttributes()
Every attribute stored in this Map will be visible to every HttpExchange processed by this context
public abstract List<Filter> getFilters()
public abstract Authenticator setAuthenticator(Authenticator auth)
auth
- the authenticator to set. If null
then any
previously set authenticator is removed,
and client authentication will no longer be required.null
otherwise.public abstract Authenticator getAuthenticator()
null
if none is set.
|
Java HTTP Server DRAFT ea-b118 |
||||||||
PREV CLASS NEXT CLASS |
FRAMES
|
||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2005, 2010, Oracle Corporation. All rights reserved.