org.apache.camel.builder
Class ErrorHandlerBuilderRef

java.lang.Object
  extended by org.apache.camel.builder.ErrorHandlerBuilderSupport
      extended by org.apache.camel.builder.ErrorHandlerBuilderRef
All Implemented Interfaces:
ErrorHandlerBuilder

public class ErrorHandlerBuilderRef
extends ErrorHandlerBuilderSupport

Represents a proxy to an error handler builder which is resolved by named reference

Version:

Field Summary
static String DEFAULT_ERROR_HANDLER_BUILDER
           
 
Constructor Summary
ErrorHandlerBuilderRef(String ref)
           
 
Method Summary
 void addErrorHandlers(OnExceptionDefinition exception)
          Adds error handler for the given exception type
 Processor createErrorHandler(RouteContext routeContext, Processor processor)
          Creates the error handler interceptor
 ErrorHandlerBuilder getHandler()
           
 String getRef()
           
static boolean isErrorHandlerBuilderConfigured(String ref)
          Returns whether a specific error handler builder has been configured or not.
protected static ErrorHandlerBuilder lookupErrorHandlerBuilder(CamelContext camelContext)
           
static ErrorHandlerBuilder lookupErrorHandlerBuilder(RouteContext routeContext, String ref)
          Lookup the error handler by the given ref
 boolean supportTransacted()
          Whether this error handler supports transacted exchanges.
 String toString()
           
 
Methods inherited from class org.apache.camel.builder.ErrorHandlerBuilderSupport
configure, exceptionPolicyStrategy, getErrorHandlers, getExceptionPolicyStrategy, setErrorHandlers, setExceptionPolicyStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_ERROR_HANDLER_BUILDER

public static final String DEFAULT_ERROR_HANDLER_BUILDER
See Also:
Constant Field Values
Constructor Detail

ErrorHandlerBuilderRef

public ErrorHandlerBuilderRef(String ref)
Method Detail

addErrorHandlers

public void addErrorHandlers(OnExceptionDefinition exception)
Description copied from interface: ErrorHandlerBuilder
Adds error handler for the given exception type

Specified by:
addErrorHandlers in interface ErrorHandlerBuilder
Overrides:
addErrorHandlers in class ErrorHandlerBuilderSupport
Parameters:
exception - the exception to handle

createErrorHandler

public Processor createErrorHandler(RouteContext routeContext,
                                    Processor processor)
                             throws Exception
Description copied from interface: ErrorHandlerBuilder
Creates the error handler interceptor

Parameters:
routeContext - the route context
processor - the outer processor
Returns:
the error handler
Throws:
Exception - is thrown if the error handler could not be created

supportTransacted

public boolean supportTransacted()
Description copied from interface: ErrorHandlerBuilder
Whether this error handler supports transacted exchanges.


lookupErrorHandlerBuilder

public static ErrorHandlerBuilder lookupErrorHandlerBuilder(RouteContext routeContext,
                                                            String ref)
Lookup the error handler by the given ref

Parameters:
routeContext - the route context
ref - reference id for the error handler
Returns:
the error handler

lookupErrorHandlerBuilder

protected static ErrorHandlerBuilder lookupErrorHandlerBuilder(CamelContext camelContext)

isErrorHandlerBuilderConfigured

public static boolean isErrorHandlerBuilderConfigured(String ref)
Returns whether a specific error handler builder has been configured or not.

Can be used to test if none has been configured and then install a custom error handler builder replacing the default error handler (that would have been used as fallback otherwise).
This is for instance used by the transacted policy to setup a TransactedErrorHandlerBuilder in camel-spring.


getRef

public String getRef()

getHandler

public ErrorHandlerBuilder getHandler()

toString

public String toString()
Overrides:
toString in class Object


Apache CAMEL