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) |
getCamelContext
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
unwrap
public 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)
CamelClusterService
public Collection<Route> getControlledRoutes()
RouteController
getControlledRoutes
in interface RouteController
getControlledRoutes
in class DefaultRouteController
public void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class DefaultRouteController
Exception
ServiceSupport.doStop()
public void doStop() throws Exception
ServiceSupport
ServiceSupport.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 DefaultRouteController
Exception
ServiceSupport.doStart()
public void setCamelContext(CamelContext camelContext)
CamelContextAware
CamelContext
setCamelContext
in interface CamelContextAware
setCamelContext
in class DefaultRouteController
camelContext
- the Camel contextpublic void startRoute(String routeId) throws Exception
startRoute
in interface RouteController
startRoute
in class DefaultRouteController
Exception
public void stopRoute(String routeId) throws Exception
stopRoute
in interface RouteController
stopRoute
in class DefaultRouteController
Exception
public void stopRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
stopRoute
in interface RouteController
stopRoute
in class DefaultRouteController
Exception
public boolean stopRoute(String routeId, long timeout, TimeUnit timeUnit, boolean abortAfterTimeout) throws Exception
stopRoute
in interface RouteController
stopRoute
in class DefaultRouteController
Exception
public void suspendRoute(String routeId) throws Exception
suspendRoute
in interface RouteController
suspendRoute
in class DefaultRouteController
Exception
public void suspendRoute(String routeId, long timeout, TimeUnit timeUnit) throws Exception
suspendRoute
in interface RouteController
suspendRoute
in class DefaultRouteController
Exception
public void resumeRoute(String routeId) throws Exception
resumeRoute
in interface RouteController
resumeRoute
in class DefaultRouteController
Exception
Apache Camel