pub trait RouteControllerInternal: RouteController + Send {
Show 15 methods
// 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 set_runtime_handle(&mut self, runtime: Arc<dyn RuntimeHandle>);
fn route_count(&self) -> usize;
fn route_ids(&self) -> Vec<String>;
fn auto_startup_route_ids(&self) -> Vec<String>;
fn shutdown_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§
Sourcefn add_route(&mut self, def: RouteDefinition) -> Result<(), CamelError>
fn add_route(&mut self, def: RouteDefinition) -> Result<(), CamelError>
Add a route definition to the controller.
Sourcefn swap_pipeline(
&self,
route_id: &str,
pipeline: BoxProcessor,
) -> Result<(), CamelError>
fn swap_pipeline( &self, route_id: &str, pipeline: BoxProcessor, ) -> Result<(), CamelError>
Atomically swap the pipeline of a running route (for hot-reload).
Sourcefn route_from_uri(&self, route_id: &str) -> Option<String>
fn route_from_uri(&self, route_id: &str) -> Option<String>
Returns the from_uri of a route by ID.
Sourcefn set_error_handler(&mut self, config: ErrorHandlerConfig)
fn set_error_handler(&mut self, config: ErrorHandlerConfig)
Set a global error handler applied to all routes.
Sourcefn set_self_ref(&mut self, self_ref: Arc<Mutex<dyn RouteController>>)
fn set_self_ref(&mut self, self_ref: Arc<Mutex<dyn RouteController>>)
Set the self-reference needed to create ProducerContext.
Sourcefn set_runtime_handle(&mut self, runtime: Arc<dyn RuntimeHandle>)
fn set_runtime_handle(&mut self, runtime: Arc<dyn RuntimeHandle>)
Set runtime handle for ProducerContext command/query access.
Sourcefn route_count(&self) -> usize
fn route_count(&self) -> usize
Returns the number of routes in the controller.
Sourcefn auto_startup_route_ids(&self) -> Vec<String>
fn auto_startup_route_ids(&self) -> Vec<String>
Returns route IDs that should auto-start, sorted by startup order (ascending).
Sourcefn shutdown_route_ids(&self) -> Vec<String>
fn shutdown_route_ids(&self) -> Vec<String>
Returns route IDs sorted by shutdown order (startup order descending).
Sourcefn set_tracer_config(&mut self, config: &TracerConfig)
fn set_tracer_config(&mut self, config: &TracerConfig)
Configure tracing from a TracerConfig.
Sourcefn compile_route_definition(
&self,
def: RouteDefinition,
) -> Result<BoxProcessor, CamelError>
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.
Sourcefn remove_route(&mut self, route_id: &str) -> Result<(), CamelError>
fn remove_route(&mut self, route_id: &str) -> Result<(), CamelError>
Remove a route from the controller map (route must be stopped first).
Sourcefn 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 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).
Sourcefn 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,
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).