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 voiddoInit()protected voiddoShutdown()static ClusteredRoutePolicyforNamespace(String namespace)static ClusteredRoutePolicyforNamespace(org.apache.camel.CamelContext camelContext, String namespace)static ClusteredRoutePolicyforNamespace(org.apache.camel.CamelContext camelContext, org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace)static ClusteredRoutePolicyforNamespace(org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace)static ClusteredRoutePolicyforNamespace(org.apache.camel.cluster.CamelClusterService service, String namespace)org.apache.camel.CamelContextgetCamelContext()DurationgetInitialDelay()booleanisLeader()voidonInit(org.apache.camel.Route route)voidonRemove(org.apache.camel.Route route)voidsetCamelContext(org.apache.camel.CamelContext camelContext)voidsetInitialDelay(Duration initialDelay)-
Methods inherited from class org.apache.camel.support.RoutePolicySupport
controller, doStart, doStop, getExceptionHandler, handleException, onExchangeBegin, onExchangeDone, 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:
getCamelContextin interfaceorg.apache.camel.CamelContextAware
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext)
- Specified by:
setCamelContextin 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:
onInitin interfaceorg.apache.camel.spi.RoutePolicy- Overrides:
onInitin classorg.apache.camel.support.RoutePolicySupport
-
doInit
protected void doInit() throws Exception- Overrides:
doInitin classorg.apache.camel.support.service.BaseService- Throws:
Exception
-
onRemove
public void onRemove(org.apache.camel.Route route)
- Specified by:
onRemovein interfaceorg.apache.camel.spi.RoutePolicy- Overrides:
onRemovein classorg.apache.camel.support.RoutePolicySupport
-
doShutdown
protected void doShutdown() throws Exception- Overrides:
doShutdownin 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
-
-