Package org.apache.camel.impl.cluster
Class ClusteredRoutePolicy
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.RoutePolicySupport
-
- org.apache.camel.impl.cluster.ClusteredRoutePolicy
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.RoutePolicy
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@ManagedResource(description="Clustered Route policy") public final class ClusteredRoutePolicy extends org.apache.camel.support.RoutePolicySupport implements org.apache.camel.CamelContextAware
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doInit()
void
doShutdown()
void
doStart()
static ClusteredRoutePolicy
forNamespace(String namespace)
static ClusteredRoutePolicy
forNamespace(org.apache.camel.CamelContext camelContext, String namespace)
static ClusteredRoutePolicy
forNamespace(org.apache.camel.CamelContext camelContext, org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace)
static ClusteredRoutePolicy
forNamespace(org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace)
static ClusteredRoutePolicy
forNamespace(org.apache.camel.cluster.CamelClusterService service, String namespace)
org.apache.camel.CamelContext
getCamelContext()
Duration
getInitialDelay()
boolean
isLeader()
void
onInit(org.apache.camel.Route route)
void
setCamelContext(org.apache.camel.CamelContext camelContext)
void
setInitialDelay(Duration initialDelay)
-
Methods inherited from class org.apache.camel.support.RoutePolicySupport
controller, doStop, getExceptionHandler, handleException, onExchangeBegin, onExchangeDone, onRemove, onResume, onStart, onStop, onSuspend, resumeOrStartConsumer, resumeRoute, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute, stopRouteAsync, suspendOrStopConsumer, suspendRoute, suspendRoute
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Method Detail
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()
- Specified by:
getCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContext
in interfaceorg.apache.camel.CamelContextAware
-
getInitialDelay
public Duration getInitialDelay()
-
setInitialDelay
public void setInitialDelay(Duration initialDelay)
-
onInit
public void onInit(org.apache.camel.Route route)
- Specified by:
onInit
in interfaceorg.apache.camel.spi.RoutePolicy
- Overrides:
onInit
in classorg.apache.camel.support.RoutePolicySupport
-
doInit
protected void doInit() throws Exception
- Overrides:
doInit
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStart
public void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.RoutePolicySupport
- Throws:
Exception
-
doShutdown
public void doShutdown() throws Exception
- Overrides:
doShutdown
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
isLeader
@ManagedAttribute(description="Is this route the master or a slave") public boolean isLeader()
-
forNamespace
public static ClusteredRoutePolicy forNamespace(org.apache.camel.CamelContext camelContext, org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace) throws Exception
- Throws:
Exception
-
forNamespace
public static ClusteredRoutePolicy forNamespace(org.apache.camel.CamelContext camelContext, String namespace) throws Exception
- Throws:
Exception
-
forNamespace
public static ClusteredRoutePolicy forNamespace(org.apache.camel.cluster.CamelClusterService service, String namespace) throws Exception
- Throws:
Exception
-
forNamespace
public static ClusteredRoutePolicy forNamespace(org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace) throws Exception
- Throws:
Exception
-
forNamespace
public static ClusteredRoutePolicy forNamespace(String namespace) throws Exception
- Throws:
Exception
-
-