Package com.alibaba.dubbo.rpc.cluster.router.script

Examples of com.alibaba.dubbo.rpc.cluster.router.script.ScriptRouterFactory


        return SCRIPT_URL.addParameterAndEncoded(Constants.RULE_KEY, rule);
    }
   
    @Test
    public void testRoute_ReturnAll(){
        Router router = new ScriptRouterFactory().getRouter(getRouteUrl("function route(op1,op2){return op1} route(invokers)"));
        List<Invoker<String>> invokers = new ArrayList<Invoker<String>>();
        invokers.add(new MockInvoker<String>());
        invokers.add(new MockInvoker<String>());
        invokers.add(new MockInvoker<String>());
        List<Invoker<String>> fileredInvokers = router.route(invokers, invokers.get(0).getUrl(), new RpcInvocation());
View Full Code Here


                            "result.add(invokers.get(i)) ;" +
                        "}" +
                    "} ; " +
                    "return result;";
        String script = "function route(invokers,invocation,context){" + rule + "} route(invokers,invocation,context)";
        Router router = new ScriptRouterFactory().getRouter(getRouteUrl(script));
       
        List<Invoker<String>> invokers = new ArrayList<Invoker<String>>();
        Invoker<String> invoker1 = new MockInvoker<String>(false) ;
        Invoker<String> invoker2 = new MockInvoker<String>(true) ;
        Invoker<String> invoker3 = new MockInvoker<String>(true) ;
View Full Code Here

TOP

Related Classes of com.alibaba.dubbo.rpc.cluster.router.script.ScriptRouterFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.