io.undertow.server.handlers.cache

## Class CacheHandler

- java.lang.Object
- - io.undertow.server.handlers.cache.CacheHandler

All Implemented Interfaces:
  HttpHandler

    public class CacheHandler
    extends Object
    implements HttpHandler

Handler that attaches a cache to the exchange, a handler can query this cache to see if the cache has a cached copy of the content, and if so have the cache serve this content automatically.

Author:
  Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`CacheHandler(DirectBufferCache cache)`
`CacheHandler(DirectBufferCache cache, HttpHandler next)`

### Method Summary

All Methods Instance Methods Concrete Methods
`HttpHandler` `getNext()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`CacheHandler` `setNext(HttpHandler next)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CacheHandler

    public CacheHandler(DirectBufferCache cache,
                        HttpHandler next)

#### CacheHandler

    public CacheHandler(DirectBufferCache cache)

### Method Detail

#### handleRequest

    public void handleRequest(HttpServerExchange exchange)
                       throws Exception

Description copied from interface: `HttpHandler`
Handle the request.

Specified by:
  `handleRequest` in interface `HttpHandler`
Parameters:
  `exchange` - the HTTP request/response exchange
Throws:
  `Exception`

#### getNext

    public HttpHandler getNext()

#### setNext

    public CacheHandler setNext(HttpHandler next)