Class AbstractRouter

java.lang.Object
org.apache.dubbo.rpc.cluster.router.AbstractRouter
All Implemented Interfaces:
Comparable<Router>, Router

public abstract class AbstractRouter extends Object implements Router
  • Constructor Details

    • AbstractRouter

      public AbstractRouter(org.apache.dubbo.common.URL url)
    • AbstractRouter

      public AbstractRouter()
  • Method Details

    • getUrl

      public org.apache.dubbo.common.URL getUrl()
      Description copied from interface: Router
      Get the router url.
      Specified by:
      getUrl in interface Router
      Returns:
      url
    • setUrl

      public void setUrl(org.apache.dubbo.common.URL url)
    • isRuntime

      public boolean isRuntime()
      Description copied from interface: Router
      To decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.
      Specified by:
      isRuntime in interface Router
      Returns:
      true if the router need to execute every time.
    • isForce

      public boolean isForce()
      Description copied from interface: Router
      To decide whether this router should take effect when none of the invoker can match the router rule, which means the Router.route(List, URL, Invocation) would be empty. Most of time, most router implementation would default this value to false.
      Specified by:
      isForce in interface Router
      Returns:
      true to execute if none of invokers matches the current router
    • setForce

      public void setForce(boolean force)
    • getPriority

      public int getPriority()
      Description copied from interface: Router
      Router's priority, used to sort routers.
      Specified by:
      getPriority in interface Router
      Returns:
      router's priority
    • setPriority

      public void setPriority(int priority)
    • getRuleRepository

      public GovernanceRuleRepository getRuleRepository()