|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.exceptions.handling.InternalExceptionHandlerPool
public class InternalExceptionHandlerPool
An InternalExceptionHandlerPool
represents an
ExceptionHandlerPool
that is associated with a single instance's
class.
All exception scenarios internally will have a prefix
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!
Field Summary | |
---|---|
protected java.lang.Object |
client
|
protected ExceptionHandlerPool |
pool
|
Constructor Summary | |
---|---|
InternalExceptionHandlerPool(java.lang.Object client)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ExceptionHandlerPool pool
protected java.lang.Object client
Constructor Detail |
---|
public InternalExceptionHandlerPool(java.lang.Object client)
Method Detail |
---|
public <E extends java.lang.Exception,T extends java.lang.Exception> ExceptionHandler<E,T> getExceptionHandler(ExceptionScenario<E,T> scenario)
getExceptionHandler
in interface ExceptionHandling
E
- T
- scenario
-
ExceptionHandlerPool.getExceptionHandler(com.emarsys.ecommon.exceptions.handling.ExceptionScenario)
public <E extends java.lang.Exception,T extends java.lang.Exception> void registerExceptionHandler(ExceptionScenario<E,T> scenario, ExceptionHandler<E,T> handler)
registerExceptionHandler
in interface ExceptionHandling
E
- T
- scenario
- handler
- ExceptionHandlerPool.registerExceptionHandler(com.emarsys.ecommon.exceptions.handling.ExceptionScenario,
com.emarsys.ecommon.exceptions.handling.ExceptionHandler)
public <E extends java.lang.Exception,T extends java.lang.Exception> void unregisterExceptionHandler(ExceptionScenario<E,T> scenario)
ExceptionHandling
ExceptionHandler
associated with the
passed scenario if present.
unregisterExceptionHandler
in interface ExceptionHandling
E
- T
- scenario
- ExceptionHandlerPool.unregisterExceptionHandler(com.emarsys.ecommon.exceptions.handling.ExceptionScenario)
public java.util.Map<ExceptionScenario<?,?>,ExceptionHandler<?,?>> getExceptionHandlers()
ExceptionHandling
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.
getExceptionHandlers
in interface ExceptionHandling
ExceptionHandlerPool.getExceptionHandlers()
public ExceptionHandling unionExceptionHandling(ExceptionHandling handling)
ExceptionHandling
ExceptionHandler
s from the passed handling
and overwrite already existing ones; already registered distinct
handlers will remain registered.
unionExceptionHandling
in interface ExceptionHandling
ExceptionHandling
now in use.ExceptionHandlerPool.unionExceptionHandling(com.emarsys.ecommon.exceptions.handling.ExceptionHandling)
public ExceptionHandling useExceptionHandling(ExceptionHandling handling)
ExceptionHandling
useExceptionHandling
in interface ExceptionHandling
handling
-
ExceptionHandling
now in use, needs not to
be the same (identical) instance as the passed one.ExceptionHandlerPool.useExceptionHandling(com.emarsys.ecommon.exceptions.handling.ExceptionHandling)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |