Class ExceptionHandlerServiceImpl
java.lang.Object
ch.tocco.nice2.dms.impl.publish.exception.ExceptionHandlerServiceImpl
- All Implemented Interfaces:
ExceptionHandlerService
@Component
public class ExceptionHandlerServiceImpl
extends Object
implements ExceptionHandlerService
-
Constructor Summary
ConstructorDescriptionExceptionHandlerServiceImpl
(OverrideContributionService overrideContributionService) -
Method Summary
Modifier and TypeMethodDescriptionfindBestMatchingHandler
(Class<? extends Exception> exceptionClass) This method returns the best matchingExceptionHandler
for a given Exception.void
setExceptionHandlers
(List<ExceptionHandlerContribution> exceptionHandlers)
-
Constructor Details
-
ExceptionHandlerServiceImpl
-
-
Method Details
-
findBestMatchingHandler
public Optional<ExceptionHandler> findBestMatchingHandler(Class<? extends Exception> exceptionClass) Description copied from interface:ExceptionHandlerService
This method returns the best matchingExceptionHandler
for a given Exception. Best matching means that the Exception that the handler is mapped to has minimal "inheritance distance" to the given exception class.- Specified by:
findBestMatchingHandler
in interfaceExceptionHandlerService
- Parameters:
exceptionClass
- the Exception class to find an ExceptionHandler for.- Returns:
- the best matching ExceptionHandler.
-
setExceptionHandlers
-