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.HasCamelContext,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
-
Field Summary
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoInit()protected voidstatic 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.CamelContextbooleanisLeader()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, getExceptionHandler, handleException, onExchangeBegin, onExchangeDone, onResume, onStart, onStop, onSuspend, resumeOrStartConsumer, resumeRoute, setExceptionHandler, startConsumer, startRoute, stopConsumer, stopRoute, stopRoute, stopRouteAsync, suspendOrStopConsumer, suspendRoute, suspendRouteMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Method Details
-
getCamelContext
public org.apache.camel.CamelContext getCamelContext()- Specified by:
getCamelContextin interfaceorg.apache.camel.spi.HasCamelContext
-
setCamelContext
public void setCamelContext(org.apache.camel.CamelContext camelContext) - Specified by:
setCamelContextin interfaceorg.apache.camel.CamelContextAware
-
getInitialDelay
-
setInitialDelay
-
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
- 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
- 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
- Throws:
Exception
-