Skip to main content

RouteControllerInternal

Trait RouteControllerInternal 

Source
pub trait RouteControllerInternal: RouteController + Send {
    // Required methods
    fn add_route(&mut self, def: RouteDefinition) -> Result<(), CamelError>;
    fn swap_pipeline(
        &self,
        route_id: &str,
        pipeline: BoxProcessor,
    ) -> Result<(), CamelError>;
    fn route_from_uri(&self, route_id: &str) -> Option<String>;
    fn set_error_handler(&mut self, config: ErrorHandlerConfig);
    fn set_self_ref(&mut self, self_ref: Arc<Mutex<dyn RouteController>>);
    fn route_count(&self) -> usize;
    fn route_ids(&self) -> Vec<String>;
    fn set_tracer_config(&mut self, config: &TracerConfig);
    fn compile_route_definition(
        &self,
        def: RouteDefinition,
    ) -> Result<BoxProcessor, CamelError>;
    fn remove_route(&mut self, route_id: &str) -> Result<(), CamelError>;
    fn start_route_reload<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        route_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn stop_route_reload<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        route_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Internal trait extending RouteController with methods needed by [CamelContext] that are not part of the public lifecycle API.

Both DefaultRouteController and the future SupervisingRouteController implement this trait, allowing CamelContext to hold either as Arc<Mutex<dyn RouteControllerInternal>>.

Required Methods§

Source

fn add_route(&mut self, def: RouteDefinition) -> Result<(), CamelError>

Add a route definition to the controller.

Source

fn swap_pipeline( &self, route_id: &str, pipeline: BoxProcessor, ) -> Result<(), CamelError>

Atomically swap the pipeline of a running route (for hot-reload).

Source

fn route_from_uri(&self, route_id: &str) -> Option<String>

Returns the from_uri of a route by ID.

Source

fn set_error_handler(&mut self, config: ErrorHandlerConfig)

Set a global error handler applied to all routes.

Source

fn set_self_ref(&mut self, self_ref: Arc<Mutex<dyn RouteController>>)

Set the self-reference needed to create ProducerContext.

Source

fn route_count(&self) -> usize

Returns the number of routes in the controller.

Source

fn route_ids(&self) -> Vec<String>

Returns all route IDs.

Source

fn set_tracer_config(&mut self, config: &TracerConfig)

Configure tracing from a TracerConfig.

Source

fn compile_route_definition( &self, def: RouteDefinition, ) -> Result<BoxProcessor, CamelError>

Compile a RouteDefinition into a BoxProcessor without inserting it into the route map. Used by hot-reload to prepare a new pipeline for atomic swap.

Source

fn remove_route(&mut self, route_id: &str) -> Result<(), CamelError>

Remove a route from the controller map (route must be stopped first).

Source

fn start_route_reload<'life0, 'life1, 'async_trait>( &'life0 mut self, route_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Start a route by ID (for use by hot-reload, where async_trait is required).

Source

fn stop_route_reload<'life0, 'life1, 'async_trait>( &'life0 mut self, route_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stop a route by ID (for use by hot-reload, where async_trait is required).

Implementors§