public class ExceptionHandlers
extends java.lang.Object
A set of exception handlers is configured by defining ExceptionHandlersConfiguration beans
in spring.xml. If a project needs specific handlers, it should define a bean of such type with its own
id, e.g. refapp_ExceptionHandlersConfiguration
An instance of this class is bound to App.
| Modifier and Type | Field and Description |
|---|---|
protected App |
app |
protected org.springframework.context.ApplicationContext |
applicationContext |
protected ExceptionHandler |
defaultHandler |
protected java.util.List<UiExceptionHandler> |
genericHandlers |
protected java.util.List<ExceptionHandler> |
handlers |
| Constructor and Description |
|---|
ExceptionHandlers(App app,
org.springframework.context.ApplicationContext applicationContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHandler(ExceptionHandler handler)
Adds new Web-level handler if it is not yet registered.
|
void |
addHandler(UiExceptionHandler handler)
Adds new GUI-level handler if it is not yet registered.
|
void |
createByConfiguration()
Create all Web handlers defined by
ExceptionHandlersConfiguration beans in spring.xml and
GUI handlers defined as Spring-beans. |
ExceptionHandler |
getDefaultHandler() |
void |
handle(com.vaadin.server.ErrorEvent event)
Delegates exception handling to registered handlers.
|
void |
removeAll()
Remove all handlers.
|
void |
setDefaultHandler(ExceptionHandler defaultHandler)
Set the default handler instead of initialized in constructor.
|
protected App app
protected org.springframework.context.ApplicationContext applicationContext
protected java.util.List<ExceptionHandler> handlers
protected java.util.List<UiExceptionHandler> genericHandlers
protected ExceptionHandler defaultHandler
public ExceptionHandlers(App app, org.springframework.context.ApplicationContext applicationContext)
public ExceptionHandler getDefaultHandler()
public void setDefaultHandler(ExceptionHandler defaultHandler)
defaultHandler - default handler instancepublic void addHandler(ExceptionHandler handler)
handler - handler instancepublic void addHandler(UiExceptionHandler handler)
handler - handler instancepublic void handle(com.vaadin.server.ErrorEvent event)
event - error event generated by Vaadinpublic void createByConfiguration()
ExceptionHandlersConfiguration beans in spring.xml and
GUI handlers defined as Spring-beans.public void removeAll()