io.undertow.server.handlers

## Class AttachmentHandler<T>

- java.lang.Object
- - io.undertow.server.handlers.AttachmentHandler<T>

All Implemented Interfaces:
  HttpHandler

    public class AttachmentHandler<T>
    extends Object
    implements HttpHandler

Handler that adds an attachment to the request

Author:
  Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`AttachmentHandler(AttachmentKey<T> key, HttpHandler next)`
`AttachmentHandler(AttachmentKey<T> key, HttpHandler next, T instance)`

### Method Summary

All Methods Instance Methods Concrete Methods
`T` `getInstance()`
`HttpHandler` `getNext()`
`void` `handleRequest(HttpServerExchange exchange)` Handle the request.
`void` `setInstance(T instance)`
`void` `setNext(HttpHandler next)`

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

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

### Constructor Detail

#### AttachmentHandler

    public AttachmentHandler(AttachmentKey<T> key,
                             HttpHandler next,
                             T instance)

#### AttachmentHandler

    public AttachmentHandler(AttachmentKey<T> key,
                             HttpHandler next)

### 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`

#### getInstance

    public T getInstance()

#### setInstance

    public void setInstance(T instance)

#### getNext

    public HttpHandler getNext()

#### setNext

    public void setNext(HttpHandler next)