@ManagedResource(description="Clustered Route policy using") public final class ClusteredRoutePolicy extends RoutePolicySupport implements CamelContextAware
log
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Modifier and Type | Method and Description |
---|---|
void |
doShutdown()
Implementations override this method to perform customized shutdown.
|
void |
doStart()
Implementations override this method to support customized start/stop.
|
static ClusteredRoutePolicy |
forNamespace(CamelClusterService.Selector selector,
String namespace) |
static ClusteredRoutePolicy |
forNamespace(CamelClusterService service,
String namespace) |
static ClusteredRoutePolicy |
forNamespace(CamelContext camelContext,
CamelClusterService.Selector selector,
String namespace) |
static ClusteredRoutePolicy |
forNamespace(CamelContext camelContext,
String namespace) |
static ClusteredRoutePolicy |
forNamespace(String namespace) |
CamelContext |
getCamelContext()
Get the
CamelContext |
Duration |
getInitialDelay() |
boolean |
isLeader() |
void |
onInit(Route route)
Callback invoked when the
Route is being initialized |
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setInitialDelay(Duration initialDelay) |
doStop, getExceptionHandler, handleException, onExchangeBegin, onExchangeDone, onRemove, onResume, onStart, onStop, onSuspend, resumeOrStartConsumer, resumeRoute, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute, stopRouteAsync, suspendOrStopConsumer, suspendRoute, suspendRoute
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public CamelContext getCamelContext()
CamelContextAware
CamelContext
getCamelContext
in interface CamelContextAware
public void setCamelContext(CamelContext camelContext)
CamelContextAware
CamelContext
setCamelContext
in interface CamelContextAware
camelContext
- the Camel contextpublic Duration getInitialDelay()
public void setInitialDelay(Duration initialDelay)
public void onInit(Route route)
RoutePolicy
Route
is being initializedonInit
in interface RoutePolicy
onInit
in class RoutePolicySupport
route
- the route being initializedpublic void doStart() throws Exception
ServiceSupport
ServiceSupport.doStop()
for more details.doStart
in class RoutePolicySupport
Exception
ServiceSupport.doStop()
public void doShutdown() throws Exception
ServiceSupport
doShutdown
in class ServiceSupport
Exception
@ManagedAttribute(description="Is this route the master or a slave") public boolean isLeader()
public static ClusteredRoutePolicy forNamespace(CamelContext camelContext, CamelClusterService.Selector selector, String namespace) throws Exception
Exception
public static ClusteredRoutePolicy forNamespace(CamelContext camelContext, String namespace) throws Exception
Exception
public static ClusteredRoutePolicy forNamespace(CamelClusterService service, String namespace) throws Exception
Exception
public static ClusteredRoutePolicy forNamespace(CamelClusterService.Selector selector, String namespace) throws Exception
Exception
public static ClusteredRoutePolicy forNamespace(String namespace) throws Exception
Exception
Apache Camel