public class ClusteredRouteController extends DefaultRouteController
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
ClusteredRouteController() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFilter(ClusteredRouteFilter filter)
Add a filter used to to filter cluster aware routes.
|
void |
addRouteConfiguration(String routeId,
ClusteredRouteConfiguration configuration)
Add a configuration for the given route.
|
void |
doStart()
Implementations override this method to support customized start/stop.
|
void |
doStop()
Implementations override this method to support customized start/stop.
|
CamelClusterService |
getClusterService() |
CamelClusterService.Selector |
getClusterServiceSelector() |
Collection<Route> |
getControlledRoutes()
Return the list of routes controlled by this controller.
|
Collection<ClusteredRouteFilter> |
getFilters() |
Duration |
getInitialDelay() |
String |
getNamespace() |
Map<String,ClusteredRouteConfiguration> |
getRoutesConfiguration() |
void |
resumeRoute(String routeId) |
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setClusterService(CamelClusterService clusterService)
Set the cluster service to use.
|
void |
setClusterServiceSelector(CamelClusterService.Selector clusterServiceSelector)
Set the selector strategy to look-up a
CamelClusterService |
void |
setFilters(Collection<ClusteredRouteFilter> filters)
Sets the filters used to filter cluster aware routes.
|
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.
|
void |
setNamespace(String namespace)
Set the default namespace.
|
void |
setRoutesConfiguration(Map<String,ClusteredRouteConfiguration> configurations)
Sets the configurations for the routes.
|
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) |
getCamelContextdoResume, doShutdown, 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 ClusteredRouteController()
public void addFilter(ClusteredRouteFilter filter)
public void setFilters(Collection<ClusteredRouteFilter> filters)
public Collection<ClusteredRouteFilter> getFilters()
public void addRouteConfiguration(String routeId, ClusteredRouteConfiguration configuration)
public void setRoutesConfiguration(Map<String,ClusteredRouteConfiguration> configurations)
public Map<String,ClusteredRouteConfiguration> getRoutesConfiguration()
public Duration getInitialDelay()
public void setInitialDelay(Duration initialDelay)
initialDelay - the initial delay.public String getNamespace()
public void setNamespace(String namespace)
public CamelClusterService getClusterService()
public void setClusterService(CamelClusterService clusterService)
public CamelClusterService.Selector getClusterServiceSelector()
public void setClusterServiceSelector(CamelClusterService.Selector clusterServiceSelector)
CamelClusterServicepublic Collection<Route> getControlledRoutes()
RouteControllergetControlledRoutes in interface RouteControllergetControlledRoutes in class DefaultRouteControllerpublic void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class DefaultRouteControllerExceptionServiceSupport.doStop()public 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()public void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwaresetCamelContext in class DefaultRouteControllercamelContext - the Camel contextpublic 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 DefaultRouteControllerExceptionApache Camel