public interface RouteController extends CamelContextAware, StaticService
Route
's.Modifier and Type | Method and Description |
---|---|
<T extends RouteController> |
adapt(Class<T> type)
Adapts this
RouteController to the specialized type. |
Collection<Route> |
getControlledRoutes()
Return the list of routes controlled by this controller.
|
LoggingLevel |
getRouteStartupLoggingLevel()
Gets the logging level used for logging route startup activity.
|
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 |
setRouteStartupLoggingLevel(LoggingLevel loggingLevel)
Sets the logging level used for logging route startup activity.
|
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. |
SupervisingRouteController |
supervising()
Enables supervising
RouteController . |
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. |
getCamelContext, setCamelContext, trySetCamelContext
LoggingLevel getRouteStartupLoggingLevel()
void setRouteStartupLoggingLevel(LoggingLevel loggingLevel)
SupervisingRouteController supervising()
RouteController
.<T extends RouteController> T adapt(Class<T> type)
RouteController
to the specialized type.
For example to adapt to SupervisingRouteController.type
- the type to adapt toCamelContext
adapted to the given typeCollection<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 reasonApache Camel