Package org.apache.camel.model
Class RouteConfigurationDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<RouteConfigurationDefinition>
org.apache.camel.model.RouteConfigurationDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,PreconditionContainer
,org.apache.camel.NamedNode
,org.apache.camel.spi.HasCamelContext
,org.apache.camel.spi.HasId
,org.apache.camel.spi.IdAware
,org.apache.camel.spi.ResourceAware
@Metadata(label="configuration")
public class RouteConfigurationDefinition
extends OptionalIdentifiedDefinition<RouteConfigurationDefinition>
implements PreconditionContainer, org.apache.camel.spi.ResourceAware
Reusable configuration for Camel route(s).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionerrorHandler
(String ref) Sets the error handler to use, for routes that has not already been configured with an error handler.errorHandler
(org.apache.camel.ErrorHandlerFactory errorHandler) Sets the error handler to use, for routes that has not already been configured with an error handler.getLabel()
The predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.org.apache.camel.spi.Resource
Adds a route for an interceptor that intercepts every processing step.Adds a route for an interceptor that intercepts incoming messages on any inputs in this routeinterceptFrom
(String uri) Adds a route for an interceptor that intercepts incoming messages on the given endpoint.Applies a route for an interceptor if an exchange is send to the given endpointOn completion callback for doing custom routing when theExchange
is complete.onException
(Class<? extends Throwable> exceptionType) Exception clause for catching certain exceptions and handling them.final OnExceptionDefinition
onException
(Class<? extends Throwable>... exceptions) Exception clause for catching certain exceptions and handling them.precondition
(String precondition) Sets the predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.void
setErrorHandler
(ErrorHandlerDefinition errorHandler) void
setInterceptFroms
(List<InterceptFromDefinition> interceptFroms) void
setIntercepts
(List<InterceptDefinition> intercepts) void
setInterceptSendTos
(List<InterceptSendToEndpointDefinition> interceptSendTos) void
setOnCompletions
(List<OnCompletionDefinition> onCompletions) void
setOnExceptions
(List<OnExceptionDefinition> onExceptions) void
setPrecondition
(String precondition) The predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.void
setResource
(org.apache.camel.spi.Resource resource) toString()
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getParent, hasCustomIdAssigned, id, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.camel.LineNumberAware
getLineNumber, getLocation, setLineNumber, setLocation
Methods inherited from interface org.apache.camel.NamedNode
getDescriptionText, getId, getParent
-
Constructor Details
-
RouteConfigurationDefinition
public RouteConfigurationDefinition()
-
-
Method Details
-
toString
-
getShortName
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
-
getLabel
- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
-
getResource
public org.apache.camel.spi.Resource getResource()- Specified by:
getResource
in interfaceorg.apache.camel.spi.ResourceAware
-
setResource
public void setResource(org.apache.camel.spi.Resource resource) - Specified by:
setResource
in interfaceorg.apache.camel.spi.ResourceAware
-
getErrorHandler
-
setErrorHandler
-
getOnExceptions
-
setOnExceptions
-
getOnCompletions
-
setOnCompletions
-
getIntercepts
-
setIntercepts
-
getInterceptFroms
-
setInterceptFroms
-
getInterceptSendTos
-
setInterceptSendTos
-
getPrecondition
The predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.- Specified by:
getPrecondition
in interfacePreconditionContainer
-
setPrecondition
The predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.- Specified by:
setPrecondition
in interfacePreconditionContainer
-
errorHandler
Sets the error handler to use, for routes that has not already been configured with an error handler.- Parameters:
ref
- reference to existing error handler- Returns:
- the builder
-
errorHandler
Sets the error handler to use, for routes that has not already been configured with an error handler.- Parameters:
errorHandler
- the error handler- Returns:
- the builder
-
precondition
Sets the predicate of the precondition in simple language to evaluate in order to determine if this route configuration should be included or not.- Parameters:
precondition
- the predicate corresponding to the test to evaluate.- Returns:
- the builder
-
onException
Exception clause for catching certain exceptions and handling them.- Parameters:
exceptionType
- the exception to catch- Returns:
- the exception builder to configure
-
onException
@SafeVarargs public final OnExceptionDefinition onException(Class<? extends Throwable>... exceptions) Exception clause for catching certain exceptions and handling them.- Parameters:
exceptions
- list of exceptions to catch- Returns:
- the exception builder to configure
-
onCompletion
On completion callback for doing custom routing when theExchange
is complete.- Returns:
- the on completion builder to configure
-
intercept
Adds a route for an interceptor that intercepts every processing step.- Returns:
- the builder
-
interceptFrom
Adds a route for an interceptor that intercepts incoming messages on any inputs in this route- Returns:
- the builder
-
interceptFrom
Adds a route for an interceptor that intercepts incoming messages on the given endpoint.- Parameters:
uri
- endpoint uri- Returns:
- the builder
-
interceptSendToEndpoint
Applies a route for an interceptor if an exchange is send to the given endpoint- Parameters:
uri
- endpoint uri- Returns:
- the builder
-