|
Java HTTP Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.net.httpserver.Filter
public abstract class Filter
A filter used to pre- and post-process incoming requests. Pre-processing occurs before the application's exchange handler is invoked, and post-processing occurs after the exchange handler returns. Filters are organised in chains, and are associated with HttpContext instances.
Each Filter in the chain, invokes the next filter within its own doFilter() implementation. The final Filter in the chain invokes the applications exchange handler.
Nested Class Summary | |
---|---|
static class |
Filter.Chain
a chain of filters associated with a HttpServer. |
Constructor Summary | |
---|---|
protected |
Filter()
|
Method Summary | |
---|---|
abstract String |
description()
returns a short description of this Filter |
abstract void |
doFilter(HttpExchange exchange,
Filter.Chain chain)
Asks this filter to pre/post-process the given exchange. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Filter()
Method Detail |
---|
public abstract void doFilter(HttpExchange exchange, Filter.Chain chain) throws IOException
HttpExchange.setStreams(InputStream,OutputStream)
Filter.Chain.doFilter(HttpExchange)
Filter.Chain.doFilter(HttpExchange)
exchange
- the HttpExchange
to be filtered.chain
- the Chain which allows the next filter to be invoked.
IOException
- may be thrown by any filter module, and if
caught, must be rethrown again.
NullPointerException
- if either exchange or chain are null
public abstract String description()
|
Java HTTP Server | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |