Class AbstractRouter
java.lang.Object
org.apache.dubbo.rpc.cluster.router.AbstractRouter
- All Implemented Interfaces:
Comparable<Router>,Router
-
Field Summary
Fields inherited from interface org.apache.dubbo.rpc.cluster.Router
DEFAULT_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintRouter's priority, used to sort routers.org.apache.dubbo.common.URLgetUrl()Get the router url.booleanisForce()To decide whether this router should take effect when none of the invoker can match the router rule, which means theRouter.route(List, URL, Invocation)would be empty.booleanTo decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change.voidsetForce(boolean force) voidsetPriority(int priority) voidsetUrl(org.apache.dubbo.common.URL url)
-
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:RouterGet the router url. -
setUrl
public void setUrl(org.apache.dubbo.common.URL url) -
isRuntime
public boolean isRuntime()Description copied from interface:RouterTo decide whether this router need to execute every time an RPC comes or should only execute when addresses or rule change. -
isForce
public boolean isForce()Description copied from interface:RouterTo decide whether this router should take effect when none of the invoker can match the router rule, which means theRouter.route(List, URL, Invocation)would be empty. Most of time, most router implementation would default this value to false. -
setForce
public void setForce(boolean force) -
getPriority
public int getPriority()Description copied from interface:RouterRouter's priority, used to sort routers.- Specified by:
getPriorityin interfaceRouter- Returns:
- router's priority
-
setPriority
public void setPriority(int priority) -
getRuleRepository
-