Class 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
    • 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

      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 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 Detail

      • getCamelContext

        public org.apache.camel.CamelContext getCamelContext()
        Specified by:
        getCamelContext in interface org.apache.camel.CamelContextAware
      • 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
      • doStart

        public void doStart()
                     throws Exception
        Overrides:
        doStart in class org.apache.camel.support.RoutePolicySupport
        Throws:
        Exception
      • doShutdown

        public 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