@Decorator public class ErrorHandler extends Object implements RouteProcessor
RouteProcessor.
By wrapping the call to RouteProcessor.process(RouteContext) with a try catch block, this class
will handle any exception thrown and either forward to a the appropriate error route configured, or if no error
route exists, forward to the default error view.| Modifier and Type | Field and Description |
|---|---|
private javax.enterprise.inject.spi.BeanManager |
beanManager |
private ControllerFactory |
controllerFactory |
private RouteProcessor |
delegate |
private Responders |
responders |
| Constructor and Description |
|---|
ErrorHandler(RouteProcessor delegate,
Responders responders,
ControllerFactory controllerFactory,
javax.enterprise.inject.spi.BeanManager beanManager) |
| Modifier and Type | Method and Description |
|---|---|
private Object |
getController(Route route) |
private Object |
invokeErrorRoute(RouteContext routeContext,
Throwable t) |
void |
process(RouteContext routeContext)
Handles the actual invocation of the target or the passed-in
Route. |
private final RouteProcessor delegate
private final ControllerFactory controllerFactory
private final javax.enterprise.inject.spi.BeanManager beanManager
private final Responders responders
@Inject
public ErrorHandler(@Delegate
RouteProcessor delegate,
Responders responders,
ControllerFactory controllerFactory,
javax.enterprise.inject.spi.BeanManager beanManager)
public void process(RouteContext routeContext) throws Exception
RouteProcessorRoute.process in interface RouteProcessorrouteContext - the RouteContext for the current request.Exception - if processing of the route causes an exception.private Object invokeErrorRoute(RouteContext routeContext, Throwable t) throws javax.servlet.ServletException
javax.servlet.ServletExceptionCopyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.