ErrorHandlerBuilder builder = routeContext.getRoute().getErrorHandlerBuilder();
// check if its a ref if so then do a lookup
if (builder instanceof ErrorHandlerBuilderRef) {
// its a reference to a error handler so lookup the reference
ErrorHandlerBuilderRef ref = (ErrorHandlerBuilderRef) builder;
// only lookup if there was explicit an error handler builder configured
// otherwise its just the "default" that has not explicit been configured
// and if so then we can safely replace that with our transacted error handler
if (ref.isErrorHandlerBuilderConfigued()) {
if (LOG.isDebugEnabled()) {
LOG.debug("Looking up ErrorHandlerBuilder with ref: " + ref.getRef());
}
builder = ref.lookupErrorHandlerBuilder(routeContext);
}
}
if (builder != null && builder.supportTransacted()) {
// already a TX error handler then we are good to go