Class 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 Detail

      • RoutesDefinition

        public RoutesDefinition()
    • Method Detail

      • getShortName

        public String getShortName()
        Specified by:
        getShortName in interface org.apache.camel.NamedNode
      • getLabel

        public String getLabel()
        Specified by:
        getLabel in interface org.apache.camel.NamedNode
      • 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 interface org.apache.camel.spi.ResourceAware
      • setResource

        public void setResource​(org.apache.camel.spi.Resource resource)
        Specified by:
        setResource in interface org.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
      • 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
      • 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