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.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
Constructors Constructor Description RoutesDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RouteDefinitioncreateRoute()RouteDefinitionfrom(String uri)Creates a new route from the given URI inputRouteDefinitionfrom(EndpointConsumerBuilder endpoint)RouteDefinitionfrom(org.apache.camel.Endpoint endpoint)Creates a new route from the given endpointorg.apache.camel.CamelContextgetCamelContext()org.apache.camel.ErrorHandlerFactorygetErrorHandlerFactory()List<InterceptFromDefinition>getInterceptFroms()List<InterceptDefinition>getIntercepts()List<InterceptSendToEndpointDefinition>getInterceptSendTos()StringgetLabel()List<OnCompletionDefinition>getOnCompletions()List<OnExceptionDefinition>getOnExceptions()org.apache.camel.spi.ResourcegetResource()List<RouteDefinition>getRoutes()Returns the routesStringgetShortName()InterceptDefinitionintercept()Creates and adds an interceptor that is triggered on every step in the route processing.InterceptFromDefinitioninterceptFrom()Creates and adds an interceptor that is triggered when an exchange is received as input to any routes (eg from all the from)InterceptFromDefinitioninterceptFrom(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)InterceptSendToEndpointDefinitioninterceptSendToEndpoint(String uri)Creates and adds an interceptor that is triggered when an exchange is send to the given endpointOnCompletionDefinitiononCompletion()Adds an on completionOnExceptionDefinitiononException(Class<? extends Throwable> exception)Adds an on exceptionvoidprepareRoute(RouteDefinition route)RouteDefinitionroute()Creates a new route Prefer to use the from methods when creating a new route.RouteDefinitionroute(RouteDefinition route)Creates a new route using the given route.voidsetCamelContext(org.apache.camel.CamelContext camelContext)voidsetErrorHandlerFactory(org.apache.camel.ErrorHandlerFactory errorHandlerFactory)voidsetInterceptFroms(List<InterceptFromDefinition> interceptFroms)voidsetIntercepts(List<InterceptDefinition> intercepts)voidsetInterceptSendTos(List<InterceptSendToEndpointDefinition> interceptSendTos)voidsetOnCompletions(List<OnCompletionDefinition> onCompletions)voidsetOnExceptions(List<OnExceptionDefinition> onExceptions)voidsetResource(org.apache.camel.spi.Resource resource)voidsetRoutes(List<RouteDefinition> routes)Sets the routes to useStringtoString()-
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, description, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, getParent, hasCustomIdAssigned, id, idOrCreate, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
-
-
-
Method Detail
-
getShortName
public String getShortName()
- Specified by:
getShortNamein interfaceorg.apache.camel.NamedNode
-
getLabel
public String getLabel()
- Specified by:
getLabelin interfaceorg.apache.camel.NamedNode
-
getRoutes
public List<RouteDefinition> getRoutes()
Description copied from interface:RouteContainerReturns the routes- Specified by:
getRoutesin interfaceRouteContainer- Returns:
- the routes
-
setRoutes
public void setRoutes(List<RouteDefinition> routes)
Description copied from interface:RouteContainerSets the routes to use- Specified by:
setRoutesin interfaceRouteContainer- Parameters:
routes- the routes
-
getInterceptFroms
public List<InterceptFromDefinition> getInterceptFroms()
-
setInterceptFroms
public void setInterceptFroms(List<InterceptFromDefinition> interceptFroms)
-
getInterceptSendTos
public List<InterceptSendToEndpointDefinition> getInterceptSendTos()
-
setInterceptSendTos
public void setInterceptSendTos(List<InterceptSendToEndpointDefinition> interceptSendTos)
-
getIntercepts
public List<InterceptDefinition> getIntercepts()
-
setIntercepts
public void setIntercepts(List<InterceptDefinition> intercepts)
-
getOnExceptions
public List<OnExceptionDefinition> getOnExceptions()
-
setOnExceptions
public void setOnExceptions(List<OnExceptionDefinition> onExceptions)
-
getOnCompletions
public List<OnCompletionDefinition> getOnCompletions()
-
setOnCompletions
public void setOnCompletions(List<OnCompletionDefinition> onCompletions)
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContextin interfaceorg.apache.camel.CamelContextAware- Overrides:
getCamelContextin classOptionalIdentifiedDefinition<RoutesDefinition>
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware- Overrides:
setCamelContextin 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:
getResourcein interfaceorg.apache.camel.spi.ResourceAware
-
setResource
public void setResource(org.apache.camel.spi.Resource resource)
- Specified by:
setResourcein interfaceorg.apache.camel.spi.ResourceAware
-
route
public RouteDefinition route()
Creates a new route Prefer to use the from methods when creating a new route.- Returns:
- the builder
-
from
public RouteDefinition from(@AsEndpointUri String uri)
Creates a new route from the given URI input- Parameters:
uri- the from uri- Returns:
- the builder
-
from
public RouteDefinition from(org.apache.camel.Endpoint endpoint)
Creates a new route from the given endpoint- Parameters:
endpoint- the from endpoint- Returns:
- the builder
-
from
public RouteDefinition from(EndpointConsumerBuilder endpoint)
-
route
public RouteDefinition route(RouteDefinition 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
public void prepareRoute(RouteDefinition route)
-
intercept
public InterceptDefinition intercept()
Creates and adds an interceptor that is triggered on every step in the route processing.- Returns:
- the interceptor builder to configure
-
interceptFrom
public InterceptFromDefinition 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
public InterceptFromDefinition interceptFrom(@AsEndpointUri 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)- Parameters:
uri- uri of the endpoint- Returns:
- the interceptor builder to configure
-
interceptSendToEndpoint
public InterceptSendToEndpointDefinition interceptSendToEndpoint(@AsEndpointUri String uri)
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
public OnExceptionDefinition onException(Class<? extends Throwable> exception)
Adds an on exception- Parameters:
exception- the exception- Returns:
- the builder
-
onCompletion
public OnCompletionDefinition onCompletion()
Adds an on completion- Returns:
- the builder
-
createRoute
protected RouteDefinition createRoute()
-
-