Package org.apache.camel.model
Class RoutesDefinition
java.lang.Object
org.apache.camel.model.OptionalIdentifiedDefinition<RoutesDefinition>
org.apache.camel.model.RoutesDefinition
- All Implemented Interfaces:
org.apache.camel.CamelContextAware
,org.apache.camel.LineNumberAware
,RouteContainer
,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 RoutesDefinition
extends OptionalIdentifiedDefinition<RoutesDefinition>
implements RouteContainer, org.apache.camel.CamelContextAware, org.apache.camel.spi.ResourceAware
A series of Camel routes
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected RouteDefinition
Creates a new route from the given URI inputfrom
(EndpointConsumerBuilder endpoint) Creates a new route from the given endpointfrom
(org.apache.camel.Endpoint endpoint) Creates a new route from the given endpointCreates an input to the route, and uses a variable to store a copy of the received message body (only body, not headers).fromV
(EndpointConsumerBuilder endpoint, String variableReceive) Creates an input to the route, and uses a variable to store a copy of the received message body (only body, not headers).org.apache.camel.CamelContext
org.apache.camel.ErrorHandlerFactory
getLabel()
org.apache.camel.spi.Resource
Returns the routesCreates and adds an interceptor that is triggered on every step in the route processing.Creates and adds an interceptor that is triggered when an exchange is received as input to any routes (eg from all the from)interceptFrom
(String uri) Creates and adds an interceptor that is triggered when an exchange is received as input to the route defined with the given endpoint (eg from the from)Creates and adds an interceptor that is triggered when an exchange is send to the given endpointAdds an on completiononException
(Class<? extends Throwable> exception) Adds an on exceptionvoid
prepareRoute
(RouteDefinition route) route()
Creates a new route Prefer to use the from methods when creating a new route.route
(RouteDefinition route) Creates a new route using the given route.void
setCamelContext
(org.apache.camel.CamelContext camelContext) void
setErrorHandlerFactory
(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) 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
setResource
(org.apache.camel.spi.Resource resource) void
setRoutes
(List<RouteDefinition> routes) Sets the routes to usetoString()
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getNodePrefixId, getParent, hasCustomIdAssigned, id, idOrCreate, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
Constructor Details
-
RoutesDefinition
public RoutesDefinition()
-
-
Method Details
-
toString
-
getShortName
- Specified by:
getShortName
in interfaceorg.apache.camel.NamedNode
-
getLabel
- Specified by:
getLabel
in interfaceorg.apache.camel.NamedNode
-
getRoutes
Description copied from interface:RouteContainer
Returns the routes- Specified by:
getRoutes
in interfaceRouteContainer
- Returns:
- the routes
-
setRoutes
Description copied from interface:RouteContainer
Sets the routes to use- Specified by:
setRoutes
in interfaceRouteContainer
- Parameters:
routes
- the routes
-
getInterceptFroms
-
setInterceptFroms
-
getInterceptSendTos
-
setInterceptSendTos
-
getIntercepts
-
setIntercepts
-
getOnExceptions
-
setOnExceptions
-
getOnCompletions
-
setOnCompletions
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContext
in interfaceorg.apache.camel.spi.HasCamelContext
- Overrides:
getCamelContext
in classOptionalIdentifiedDefinition<RoutesDefinition>
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
- Overrides:
setCamelContext
in classOptionalIdentifiedDefinition<RoutesDefinition>
-
getErrorHandlerFactory
public org.apache.camel.ErrorHandlerFactory getErrorHandlerFactory() -
setErrorHandlerFactory
public void setErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory) -
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
-
route
Creates a new route Prefer to use the from methods when creating a new route.- Returns:
- the builder
-
from
Creates a new route from the given URI input- Parameters:
uri
- the from uri- Returns:
- the builder
-
fromV
Creates an input to the route, and uses a variable to store a copy of the received message body (only body, not headers). This is handy for easy access to the received message body via variables.- Parameters:
uri
- the from urivariableReceive
- the name of the variable- Returns:
- the builder
-
from
Creates a new route from the given endpoint- Parameters:
endpoint
- the from endpoint- Returns:
- the builder
-
from
Creates a new route from the given endpoint- Parameters:
endpoint
- the from endpoint- Returns:
- the builder
-
fromV
Creates an input to the route, and uses a variable to store a copy of the received message body (only body, not headers). This is handy for easy access to the received message body via variables.- Parameters:
endpoint
- the from endpointvariableReceive
- the name of the variable- Returns:
- the builder
-
route
Creates a new route using the given route. Important: This API is NOT intended for Camel end users, but used internally by Camel itself.- Parameters:
route
- the route- Returns:
- the builder
-
prepareRoute
-
intercept
Creates and adds an interceptor that is triggered on every step in the route processing.- Returns:
- the interceptor builder to configure
-
interceptFrom
Creates and adds an interceptor that is triggered when an exchange is received as input to any routes (eg from all the from)- Returns:
- the interceptor builder to configure
-
interceptFrom
Creates and adds an interceptor that is triggered when an exchange is received as input to the route defined with the given endpoint (eg from the from)- Parameters:
uri
- uri of the endpoint- Returns:
- the interceptor builder to configure
-
interceptSendToEndpoint
Creates and adds an interceptor that is triggered when an exchange is send to the given endpoint- Parameters:
uri
- uri of the endpoint- Returns:
- the builder
-
onException
Adds an on exception- Parameters:
exception
- the exception- Returns:
- the builder
-
onCompletion
Adds an on completion- Returns:
- the builder
-
createRoute
-