Interface RoutesLoader

All Superinterfaces:
CamelContextAware, HasCamelContext

public interface RoutesLoader extends CamelContextAware
SPI for loading RoutesBuilder from a list of Resource.
  • Field Details

  • Method Details

    • isIgnoreLoadingError

      boolean isIgnoreLoadingError()
      Whether to ignore route loading and compilation errors (use this with care!)
    • setIgnoreLoadingError

      void setIgnoreLoadingError(boolean ignoreLoadingError)
      Whether to ignore route loading and compilation errors (use this with care!)
    • getRoutesLoader

      RoutesBuilderLoader getRoutesLoader(String extension) throws Exception
      Looks up a RoutesBuilderLoader in the registry or fallback to a factory finder mechanism if none found.
      Parameters:
      extension - the file extension for which a loader should be found.
      Returns:
      a RoutesBuilderLoader
      Throws:
      IllegalArgumentException - if no RoutesBuilderLoader can be found for the given file extension
      Exception
    • loadRoutes

      default void loadRoutes(Collection<Resource> resources) throws Exception
      Loads RoutesBuilder from the give list of Resource into the current CamelContext.
      Parameters:
      resources - the resources to be loaded.
      Throws:
      Exception
    • loadRoutes

      default void loadRoutes(Resource... resources) throws Exception
      Loads RoutesBuilder from the give list of Resource into the current CamelContext.
      Parameters:
      resources - the resources to be loaded.
      Throws:
      Exception
    • updateRoutes

      default Set<String> updateRoutes(Resource... resources) throws Exception
      Loads or updates existing RoutesBuilder from the give list of Resource into the current CamelContext. If a route is loaded with a route id for an existing route, then the existing route is stopped and remove, so it can be updated.
      Parameters:
      resources - the resources to be loaded or updated.
      Returns:
      route ids for the routes that was loaded or updated.
      Throws:
      Exception
    • updateRoutes

      Set<String> updateRoutes(Collection<Resource> resources) throws Exception
      Loads or updates existing RoutesBuilder from the give list of Resource into the current CamelContext. If a route is loaded with a route id for an existing route, then the existing route is stopped and remove, so it can be updated.
      Parameters:
      resources - the resources to be loaded or updated.
      Returns:
      route ids for the routes that was loaded or updated.
      Throws:
      Exception
    • findRoutesBuilders

      default Collection<RoutesBuilder> findRoutesBuilders(Resource... resources) throws Exception
      Find RoutesBuilder from the give list of Resource.
      Parameters:
      resources - the resource to be loaded.
      Returns:
      a collection of RoutesBuilder
      Throws:
      Exception
    • findRoutesBuilders

      Collection<RoutesBuilder> findRoutesBuilders(Collection<Resource> resources) throws Exception
      Find RoutesBuilder from the give list of Resource.
      Parameters:
      resources - the resource to be loaded.
      Returns:
      a collection RoutesBuilder
      Throws:
      Exception
    • findRoutesBuilders

      Collection<RoutesBuilder> findRoutesBuilders(Collection<Resource> resources, boolean optional) throws Exception
      Find RoutesBuilder from the give list of Resource.
      Parameters:
      resources - the resource to be loaded.
      optional - whether parsing the resource is optional, such as there is no supported parser for the given resource extension
      Returns:
      a collection RoutesBuilder
      Throws:
      Exception
    • preParseRoute

      default void preParseRoute(Resource resource, boolean optional) throws Exception
      Pre-parses the RoutesBuilder from Resource. This is used during bootstrap, to eager detect configurations from route DSL resources which makes it possible to specify configurations that affect the bootstrap, such as by camel-jbang and camel-yaml-dsl.
      Parameters:
      resource - the resource to be pre parsed.
      optional - whether parsing the resource is optional, such as there is no supported parser for the given resource extension
      Throws:
      Exception
    • initRoutesBuilderLoader

      default void initRoutesBuilderLoader(RoutesBuilderLoader loader)
      Initializes the discovered RoutesBuilderLoader before its started and used for the first time.