public class SupervisingRouteController extends DefaultRouteController
RouteController that delays the startup
of the routes after the camel context startup and retries to start failing routes.
NOTE: this is experimental/unstable.| Modifier and Type | Class and Description |
|---|---|
static interface |
SupervisingRouteController.Filter |
static class |
SupervisingRouteController.FilterResult |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
SupervisingRouteController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(SupervisingRouteController.Filter filter)
Add a filter used to determine the routes to supervise.
|
protected void |
doShutdown()
Implementations override this method to perform customized shutdown.
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
BackOff |
getBackOff(String id) |
Map<String,BackOff> |
getBackOffConfigurations() |
Optional<BackOffTimer.Task> |
getBackOffContext(String id) |
Collection<Route> |
getControlledRoutes()
Return the list of routes controlled by this controller.
|
BackOff |
getDefaultBackOff() |
Collection<SupervisingRouteController.Filter> |
getFilters() |
Duration |
getInitialDelay() |
void |
resumeRoute(String routeId) |
void |
setBackOff(String id,
BackOff backOff)
Sets the back-off to be applied to the given
id. |
void |
setBackOffConfigurations(Map<String,BackOff> backOffConfigurations)
Set the back-off for the given IDs.
|
void |
setDefaultBackOff(BackOff defaultBackOff)
Sets the default back-off.
|
void |
setFilters(Collection<SupervisingRouteController.Filter> filters)
Sets the filters user to determine the routes to supervise.
|
void |
setInitialDelay(Duration initialDelay)
Set the amount of time the route controller should wait before to start
the routes after the camel context is started or after the route is
initialized if the route is created after the camel context is started.
|
void |
setInitialDelay(long initialDelay)
#see
this#setInitialDelay(Duration) |
void |
setInitialDelay(long initialDelay,
TimeUnit initialDelayUnit)
#see
this#setInitialDelay(Duration) |
void |
startRoute(String routeId) |
void |
stopRoute(String routeId) |
void |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit) |
boolean |
stopRoute(String routeId,
long timeout,
TimeUnit timeUnit,
boolean abortAfterTimeout) |
void |
suspendRoute(String routeId) |
void |
suspendRoute(String routeId,
long timeout,
TimeUnit timeUnit) |
getCamelContext, setCamelContextdoResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitunwrappublic SupervisingRouteController()
public BackOff getDefaultBackOff()
public void setDefaultBackOff(BackOff defaultBackOff)
public Map<String,BackOff> getBackOffConfigurations()
public void setBackOffConfigurations(Map<String,BackOff> backOffConfigurations)
public BackOff getBackOff(String id)
public void setBackOff(String id, BackOff backOff)
id.public Duration getInitialDelay()
public void setInitialDelay(Duration initialDelay)
initialDelay - the initial delay.public void setInitialDelay(long initialDelay, TimeUnit initialDelayUnit)
this#setInitialDelay(Duration)initialDelay - the initial delay amount.public void setInitialDelay(long initialDelay)
this#setInitialDelay(Duration)initialDelay - the initial delay in milliseconds.public void addFilter(SupervisingRouteController.Filter filter)
public void setFilters(Collection<SupervisingRouteController.Filter> filters)
public Collection<SupervisingRouteController.Filter> getFilters()
public Optional<BackOffTimer.Task> getBackOffContext(String id)
protected void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultRouteControllerExceptionServiceSupport.doStop()protected void doStop() throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class DefaultRouteControllerExceptionServiceSupport.doStart()protected void doShutdown() throws Exception
ServiceSupportdoShutdown in class ServiceSupportExceptionpublic void startRoute(String routeId) throws Exception
startRoute in interface RouteControllerstartRoute in class DefaultRouteControllerExceptionpublic void stopRoute(String routeId) throws Exception
stopRoute in interface RouteControllerstopRoute in class DefaultRouteControllerExceptionpublic void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
stopRoute in interface RouteControllerstopRoute in class DefaultRouteControllerExceptionpublic boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
stopRoute in interface RouteControllerstopRoute in class DefaultRouteControllerExceptionpublic void suspendRoute(String routeId) throws Exception
suspendRoute in interface RouteControllersuspendRoute in class DefaultRouteControllerExceptionpublic void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
suspendRoute in interface RouteControllersuspendRoute in class DefaultRouteControllerExceptionpublic void resumeRoute(String routeId) throws Exception
resumeRoute in interface RouteControllerresumeRoute in class DefaultRouteControllerExceptionpublic Collection<Route> getControlledRoutes()
RouteControllergetControlledRoutes in interface RouteControllergetControlledRoutes in class DefaultRouteControllerApache Camel