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 Type
    Method
    Description
    protected void
     
    protected void
     
    forNamespace(String namespace)
     
    forNamespace(org.apache.camel.CamelContext camelContext, String namespace)
     
    forNamespace(org.apache.camel.CamelContext camelContext, org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace)
     
    forNamespace(org.apache.camel.cluster.CamelClusterService.Selector selector, String namespace)
     
    forNamespace(org.apache.camel.cluster.CamelClusterService service, String namespace)
     
    org.apache.camel.CamelContext
     
     
    boolean
     
    void
    onInit(org.apache.camel.Route route)
     
    void
    onRemove(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, 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, doStart, doStop, 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

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Method Details

    • getCamelContext

      public org.apache.camel.CamelContext getCamelContext()
      Specified by:
      getCamelContext in interface org.apache.camel.spi.HasCamelContext
    • setCamelContext

      public void setCamelContext(org.apache.camel.CamelContext camelContext)
      Specified by:
      setCamelContext in interface org.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 interface org.apache.camel.spi.RoutePolicy
      Overrides:
      onInit in class org.apache.camel.support.RoutePolicySupport
    • doInit

      protected void doInit() throws Exception
      Overrides:
      doInit in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • onRemove

      public void onRemove(org.apache.camel.Route route)
      Specified by:
      onRemove in interface org.apache.camel.spi.RoutePolicy
      Overrides:
      onRemove in class org.apache.camel.support.RoutePolicySupport
    • doShutdown

      protected void doShutdown() throws Exception
      Overrides:
      doShutdown in class org.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