use of org.apache.camel.processor.ErrorHandlerSupport in project camel by apache.
the class ErrorHandlerBuilderSupport method configure.
public void configure(RouteContext routeContext, ErrorHandler handler) {
if (handler instanceof ErrorHandlerSupport) {
ErrorHandlerSupport handlerSupport = (ErrorHandlerSupport) handler;
List<OnExceptionDefinition> list = onExceptions.get(routeContext);
if (list != null) {
for (OnExceptionDefinition exception : list) {
handlerSupport.addExceptionPolicy(routeContext, exception);
}
}
}
if (handler instanceof RedeliveryErrorHandler) {
boolean original = ((RedeliveryErrorHandler) handler).isUseOriginalMessagePolicy();
if (original) {
// ensure allow original is turned on
routeContext.setAllowUseOriginalMessage(true);
}
}
}
Aggregations