Top Description Inners Fields Constructors Methods
io.undertow.server.handlers

public Class ExceptionHandler

extends Object
implements HttpHandler
Class Inheritance
All Implemented Interfaces
io.undertow.server.HttpHandler
Imports
io.undertow.server.HttpHandler, .HttpServerExchange, io.undertow.util.AttachmentKey, java.util.List, java.util.concurrent.CopyOnWriteArrayList

Handler that dispatches to a given handler and allows mapping exceptions to be handled by additional handlers. The order the exception handlers are added is important because of inheritance. Add all child classes before their parents in order to use different handlers.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final List<ExceptionHandler.ExceptionHandlerHolder<?>>
private final HttpHandler
public static final AttachmentKey<Throwable>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T extends Throwable> ExceptionHandler
public void
handleRequest(HttpServerExchange
the HTTP request/response exchange
exchange
)

Implements io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

exceptionHandlersback to summary
private final List<ExceptionHandler.ExceptionHandlerHolder<?>> exceptionHandlers
handlerback to summary
private final HttpHandler handler
THROWABLEback to summary
public static final AttachmentKey<Throwable> THROWABLE

Constructor Detail

ExceptionHandlerback to summary
public ExceptionHandler(HttpHandler handler)

Method Detail

addExceptionHandlerback to summary
public <T extends Throwable> ExceptionHandler addExceptionHandler(Class<T> clazz, HttpHandler handler)
handleRequestback to summary
public void handleRequest(HttpServerExchange exchange) throws Exception

Implements io.undertow.server.HttpHandler.handleRequest.

Doc from io.undertow.server.HttpHandler.handleRequest.

Handle the request.

Parameters
exchange:HttpServerExchange

the HTTP request/response exchange

Annotations
@Override
io.undertow.server.handlers back to summary

private Class ExceptionHandler.ExceptionHandlerHolder<T extends Throwable>

extends Object
Class Inheritance
  • java.lang.Object
  • io.undertow.server.handlers.ExceptionHandler.ExceptionHandlerHolder

Field Summary

Modifier and TypeField and Description
private final Class<T>
private final HttpHandler

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public Class<T>
public HttpHandler
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

clazzback to summary
private final Class<T> clazz
handlerback to summary
private final HttpHandler handler

Constructor Detail

ExceptionHandlerHolderback to summary
pack-priv ExceptionHandlerHolder(Class<T> clazz, HttpHandler handler)

Method Detail

getClazzback to summary
public Class<T> getClazz()
getHandlerback to summary
public HttpHandler getHandler()