|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ExceptionHandling
Encapsulates a pluggable ExceptionHandling
mechanism.
A Class
implementing ExceptionHandling
provides
an interface to (un)register ExceptionHandler
s which
will handle Exception
s in a specific ExceptionScenario
.
Associated exception scenarios and handlers always have to fit
together, i.e. the must have the same type parameters.
NOTE: the whole pluggable exception handling (PEH) module is highly experimental and still under heavy development, don't use it in production code unless you know what you're doing!
ExceptionHandler
,
Method Summary | ||
---|---|---|
|
getExceptionHandler(ExceptionScenario<E,T> scenario)
|
|
java.util.Map<ExceptionScenario<?,?>,ExceptionHandler<?,?>> |
getExceptionHandlers()
The passed Map must not be the ExceptionHandling 's
interal, modifyable representation in order to protect from
violating invariants. |
|
|
registerExceptionHandler(ExceptionScenario<E,T> scenario,
ExceptionHandler<E,T> handler)
|
|
ExceptionHandling |
unionExceptionHandling(ExceptionHandling handling)
Will add all ExceptionHandler s from the passed handling
and overwrite already existing ones; already registered distinct
handlers will remain registered. |
|
|
unregisterExceptionHandler(ExceptionScenario<E,T> scenario)
Unregisters the ExceptionHandler associated with the
passed scenario if present. |
|
ExceptionHandling |
useExceptionHandling(ExceptionHandling handling)
Will overwrite this exception handlings behavior with the passed instance's one. |
Method Detail |
---|
<E extends java.lang.Exception,T extends java.lang.Exception> ExceptionHandler<E,T> getExceptionHandler(ExceptionScenario<E,T> scenario)
E
- T
- scenario
-
ExceptionHandler
registered for the passed
ExceptionScenario
or null
if not present.java.util.Map<ExceptionScenario<?,?>,ExceptionHandler<?,?>> getExceptionHandlers()
The passed Map
must not be the ExceptionHandling
's
interal, modifyable representation in order to protect from
violating invariants. So the returned map might be a copy or
a an immutable proxy of the exception handlings internal state.
ExceptionHandler
s registered with this instance
togheter with their associated ExceptionScenario
s
but never null
, if no handler is present an empty
Map
will be returned.
<E extends java.lang.Exception,T extends java.lang.Exception> void registerExceptionHandler(ExceptionScenario<E,T> scenario, ExceptionHandler<E,T> handler)
E
- T
- scenario
- handler
- <E extends java.lang.Exception,T extends java.lang.Exception> void unregisterExceptionHandler(ExceptionScenario<E,T> scenario)
ExceptionHandler
associated with the
passed scenario if present.
E
- T
- scenario
- ExceptionHandling useExceptionHandling(ExceptionHandling handling)
handling
-
ExceptionHandling
now in use, needs not to
be the same (identical) instance as the passed one.ExceptionHandling unionExceptionHandling(ExceptionHandling handling)
ExceptionHandler
s from the passed handling
and overwrite already existing ones; already registered distinct
handlers will remain registered.
handling
-
ExceptionHandling
now in use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |