com.alibaba.dubbo.rpc.cluster.router.script
Class ScriptRouterFactory

java.lang.Object
  extended by com.alibaba.dubbo.rpc.cluster.router.script.ScriptRouterFactory
All Implemented Interfaces:
RouterFactory

public class ScriptRouterFactory
extends Object
implements RouterFactory

ScriptRouterFactory

Script Router Factory用到的URL形如:

  1. script://registyAddress?type=js&rule=xxxx
  2. script:///path/to/routerfile.js?type=js&rule=xxxx
  3. script://D:\path\to\routerfile.js?type=js&rule=xxxx
  4. script://C:/path/to/routerfile.js?type=js&rule=xxxx
URL的Host一段包含的是Script Router内容的来源,Registry、File etc

Author:
william.liangf

Field Summary
static String NAME
           
 
Constructor Summary
ScriptRouterFactory()
           
 
Method Summary
 Router getRouter(URL url)
          Create router.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

ScriptRouterFactory

public ScriptRouterFactory()
Method Detail

getRouter

public Router getRouter(URL url)
Description copied from interface: RouterFactory
Create router.

Specified by:
getRouter in interface RouterFactory
Returns:
router


Copyright © 2012–2017 Alibaba. All rights reserved.