本文整理汇总了Java中com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils.refer方法的典型用法代码示例。如果您正苦于以下问题:Java ProtocolUtils.refer方法的具体用法?Java ProtocolUtils.refer怎么用?Java ProtocolUtils.refer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils
的用法示例。
在下文中一共展示了ProtocolUtils.refer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSticky4
import com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils; //导入方法依赖的package包/类
@Test
public void testSticky4() {
int port = NetUtils.getAvailablePort();
URL url = URL.valueOf("dubbo://127.0.0.1:"+port+"/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
ProtocolUtils.export(new DemoServiceImpl(), IDemoService.class, url);
IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
Assert.assertEquals("ok", service.get());
}
示例2: referService
import com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils; //导入方法依赖的package包/类
void referService() {
demoProxy = (IDemoService)ProtocolUtils.refer(IDemoService.class, consumerUrl);
}
示例3: testSticky2
import com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils; //导入方法依赖的package包/类
@Test
public void testSticky2(){
URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
ProtocolUtils.refer(IDemoService.class, url);
}
示例4: testSticky3
import com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils; //导入方法依赖的package包/类
@Test(expected = RpcException.class)
public void testSticky3() {
URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi?"+Constants.LAZY_CONNECT_KEY+"=true");
IDemoService service = (IDemoService)ProtocolUtils.refer(IDemoService.class, url);
service.get();
}
示例5: testSticky1
import com.alibaba.dubbo.rpc.protocol.dubbo.support.ProtocolUtils; //导入方法依赖的package包/类
@Test(expected = RpcException.class)
public void testSticky1(){
URL url = URL.valueOf("dubbo://127.0.0.1:9090/hi");
ProtocolUtils.refer(IDemoService.class, url);
}