public interface RouteController extends CamelContextAware, StaticService
Route
's.Modifier and Type | Method and Description |
---|---|
Collection<Route> |
getControlledRoutes()
Return the list of routes controlled by this controller.
|
ServiceStatus |
getRouteStatus(String routeId)
Returns the current status of the given route
|
boolean |
isStartingRoutes()
Indicates whether current thread is starting route(s).
|
void |
resumeRoute(String routeId)
Resumes the given route if it has been previously suspended
If the route does not support suspension the route will be started instead
|
void |
startAllRoutes()
Starts all the routes which currently is not started.
|
void |
startRoute(String routeId)
Starts the given route if it has been previously stopped
|
void |
stopRoute(String routeId)
Stops the given route using
ShutdownStrategy . |
void |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Stops the given route using
ShutdownStrategy with a specified timeout. |
boolean |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit,
boolean abortAfterTimeout)
Stops the given route using
ShutdownStrategy with a specified timeout
and optional abortAfterTimeout mode. |
void |
suspendRoute(String routeId)
Suspends the given route using
ShutdownStrategy . |
void |
suspendRoute(String routeId,
long timeout,
TimeUnit timeUnit)
Suspends the given route using
ShutdownStrategy with a specified timeout. |
default <T extends RouteController> |
unwrap(Class<T> clazz)
Access the underlying concrete RouteController implementation.
|
getCamelContext, setCamelContext, trySetCamelContext
Collection<Route> getControlledRoutes()
void startAllRoutes() throws Exception
Exception
- is thrown if a route could not be started for whatever reasonboolean isStartingRoutes()
LifecycleStrategy
or the likes, in case
they need to react differently.ServiceStatus getRouteStatus(String routeId)
routeId
- the route idvoid startRoute(String routeId) throws Exception
routeId
- the route idException
- is thrown if the route could not be started for whatever reasonvoid stopRoute(String routeId) throws Exception
ShutdownStrategy
.routeId
- the route idException
- is thrown if the route could not be stopped for whatever reasonsuspendRoute(String)
void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
ShutdownStrategy
with a specified timeout.routeId
- the route idtimeout
- timeouttimeUnit
- the unit to useException
- is thrown if the route could not be stopped for whatever reasonsuspendRoute(String, long, java.util.concurrent.TimeUnit)
boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
ShutdownStrategy
with a specified timeout
and optional abortAfterTimeout mode.routeId
- the route idtimeout
- timeouttimeUnit
- the unit to useabortAfterTimeout
- should abort shutdown after timeoutException
- is thrown if the route could not be stopped for whatever reasonsuspendRoute(String, long, java.util.concurrent.TimeUnit)
void suspendRoute(String routeId) throws Exception
ShutdownStrategy
.
Suspending a route is more gently than stopping, as the route consumers will be suspended (if they support)
otherwise the consumers will be stopped.
By suspending the route services will be kept running (if possible) and therefore its faster to resume the route.
If the route does not support suspension the route will be stopped insteadrouteId
- the route idException
- is thrown if the route could not be suspended for whatever reasonvoid suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
ShutdownStrategy
with a specified timeout.
Suspending a route is more gently than stopping, as the route consumers will be suspended (if they support)
otherwise the consumers will be stopped.
By suspending the route services will be kept running (if possible) and therefore its faster to resume the route.
If the route does not support suspension the route will be stopped insteadrouteId
- the route idtimeout
- timeouttimeUnit
- the unit to useException
- is thrown if the route could not be suspended for whatever reasonvoid resumeRoute(String routeId) throws Exception
routeId
- the route idException
- is thrown if the route could not be resumed for whatever reasondefault <T extends RouteController> T unwrap(Class<T> clazz)
clazz
- the proprietary class or interface of the underlying concrete RouteController.Apache Camel