Examples of refer()


Examples of com.alibaba.dubbo.rpc.Protocol.refer()

    Invoker<IHelloService> cluster = getClusterInvoker(url);       
        URL mockUrl = URL.valueOf("mock://localhost/"+IHelloService.class.getName()
        +"?getSomething.mock=return aa");
   
    Protocol protocol = new MockProtocol();
    Invoker<IHelloService> mInvoker1 = protocol.refer(IHelloService.class, mockUrl);
    invokers.add(mInvoker1);
       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

    Invoker<IHelloService> cluster = getClusterInvoker(url);       
        URL mockUrl = URL.valueOf("mock://localhost/"+IHelloService.class.getName()
        +"?getSomething.mock=return aa").addParameters(url.getParameters());
   
    Protocol protocol = new MockProtocol();
    Invoker<IHelloService> mInvoker1 = protocol.refer(IHelloService.class, mockUrl);
    invokers.add(mInvoker1);
       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

      URL mockUrl = URL.valueOf("mock://localhost/"+IHelloService.class.getName()
        +"?getSomething.mock=return aa&getSomething3xx.mock=return xx")
        .addParameters(url.getParameters());
   
    Protocol protocol = new MockProtocol();
    Invoker<IHelloService> mInvoker1 = protocol.refer(IHelloService.class, mockUrl);
    invokers.add(mInvoker1);
     
    //方法配置了mock
      RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

      URL mockUrl = URL.valueOf("mock://localhost/"+IHelloService.class.getName()
        +"?getSomething.mock=return aa&getSomething3xx.mock=return xx&sayHello.mock=return ")
        .addParameters(url.getParameters());
   
    Protocol protocol = new MockProtocol();
    Invoker<IHelloService> mInvoker1 = protocol.refer(IHelloService.class, mockUrl);
    invokers.add(mInvoker1);
     
      RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("sayHello");
      Result ret = cluster.invoke(invocation);
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

        Assert.assertFalse(server.isCalled());
        ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
        Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
        URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0");
        Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
        Invoker<HessianService> invoker = protocol.refer(HessianService.class, url);
        HessianService client = proxyFactory.getProxy(invoker);
        String result = client.sayHello("haha");
        Assert.assertTrue(server.isCalled());
        Assert.assertEquals("Hello, haha", result);
        invoker.destroy();
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

        Assert.assertFalse(server.isCalled());
        ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
        Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
        URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&client=httpclient");
        Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
        Invoker<HessianService> invoker = protocol.refer(HessianService.class, url);
        HessianService client = proxyFactory.getProxy(invoker);
        String result = client.sayHello("haha");
        Assert.assertTrue(server.isCalled());
        Assert.assertEquals("Hello, haha", result);
        invoker.destroy();
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

        HessianServiceImpl server = new HessianServiceImpl();
        ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
        Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
        URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0&timeout=10");
        Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
        Invoker<HessianService> invoker = protocol.refer(HessianService.class, url);
        HessianService client = proxyFactory.getProxy(invoker);
        try {
            client.timeOut(6000);
            fail();
        } catch (RpcException expected) {
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

        HessianServiceImpl server = new HessianServiceImpl();
        ProxyFactory proxyFactory = ExtensionLoader.getExtensionLoader(ProxyFactory.class).getAdaptiveExtension();
        Protocol protocol = ExtensionLoader.getExtensionLoader(Protocol.class).getAdaptiveExtension();
        URL url = URL.valueOf("hessian://127.0.0.1:5342/" + HessianService.class.getName() + "?version=1.0.0");
        Exporter<HessianService> exporter = protocol.export(proxyFactory.getInvoker(server, HessianService.class, url));
        Invoker<HessianService> invoker = protocol.refer(HessianService.class, url);
        HessianService client = proxyFactory.getProxy(invoker);
        try {
            client.customException();
            fail();
        } catch (MyException expected) {
View Full Code Here

Examples of com.alibaba.dubbo.rpc.Protocol.refer()

       
        Protocol InjvmProtocol = ExtensionLoader.getExtensionLoader(Protocol.class).getExtension("injvm");
       
        InjvmProtocol.export(invoker);
       
        Invoker<IEcho> refer = InjvmProtocol.refer(IEcho.class, url);
        IEcho echoProxy = proxyFactory.getProxy(refer);
       
        assertEquals("ok", echoProxy.echo("ok"));
       
        try {
View Full Code Here

Examples of com.alibaba.dubbo.rpc.support.MockProtocol.refer()

    Invoker<IHelloService> cluster = getClusterInvoker(url);       
        URL mockUrl = URL.valueOf("mock://localhost/"+IHelloService.class.getName()
        +"?getSomething.mock=return aa");
   
    Protocol protocol = new MockProtocol();
    Invoker<IHelloService> mInvoker1 = protocol.refer(IHelloService.class, mockUrl);
    invokers.add(mInvoker1);
       
    //方法配置了mock
        RpcInvocation invocation = new RpcInvocation();
    invocation.setMethodName("getSomething");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.