本文整理汇总了Java中com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker类的典型用法代码示例。如果您正苦于以下问题:Java DubboInvoker类的具体用法?Java DubboInvoker怎么用?Java DubboInvoker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DubboInvoker类属于com.alibaba.dubbo.rpc.protocol.dubbo包,在下文中一共展示了DubboInvoker类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testExport
import com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker; //导入依赖的package包/类
@Test
public void testExport() {
RegistryProtocol registryProtocol = new RegistryProtocol();
registryProtocol.setCluster(new FailfastCluster());
registryProtocol.setRegistryFactory(ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension());
Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
registryProtocol.setProtocol(dubboProtocol);
URL newRegistryUrl = registryUrl.addParameter(Constants.EXPORT_KEY, serviceUrl);
DubboInvoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
newRegistryUrl, new ExchangeClient[] { new MockedClient("10.20.20.20", 2222, true) });
Exporter<DemoService> exporter = registryProtocol.export(invoker);
Exporter<DemoService> exporter2 = registryProtocol.export(invoker);
//同一个invoker,多次export的exporter不同
Assert.assertNotSame(exporter, exporter2);
exporter.unexport();
exporter2.unexport();
}
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:20,代码来源:RegistryProtocolTest.java
示例2: testExport
import com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker; //导入依赖的package包/类
@Test
public void testExport() {
RegistryProtocol registryProtocol = new RegistryProtocol();
registryProtocol.setCluster(new FailfastCluster());
registryProtocol.setRegistryFactory(ExtensionLoader.getExtensionLoader(RegistryFactory.class).getAdaptiveExtension());
Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
registryProtocol.setProtocol(dubboProtocol);
URL newRegistryUrl = registryUrl.addParameter(Constants.EXPORT_KEY, serviceUrl);
DubboInvoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
newRegistryUrl, new ExchangeClient[]{new MockedClient("10.20.20.20", 2222, true)});
Exporter<DemoService> exporter = registryProtocol.export(invoker);
Exporter<DemoService> exporter2 = registryProtocol.export(invoker);
//同一个invoker,多次export的exporter不同
Assert.assertNotSame(exporter, exporter2);
exporter.unexport();
exporter2.unexport();
}
开发者ID:l1325169021,项目名称:github-test,代码行数:20,代码来源:RegistryProtocolTest.java
示例3: testExportUrlNull
import com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker; //导入依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testExportUrlNull() {
RegistryProtocol registryProtocol = new RegistryProtocol();
registryProtocol.setCluster(new FailfastCluster());
Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
registryProtocol.setProtocol(dubboProtocol);
Invoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
registryUrl, new ExchangeClient[] { new MockedClient("10.20.20.20", 2222, true) });
registryProtocol.export(invoker);
}
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:12,代码来源:RegistryProtocolTest.java
示例4: testExportUrlNull
import com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker; //导入依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void testExportUrlNull() {
RegistryProtocol registryProtocol = new RegistryProtocol();
registryProtocol.setCluster(new FailfastCluster());
Protocol dubboProtocol = DubboProtocol.getDubboProtocol();
registryProtocol.setProtocol(dubboProtocol);
Invoker<DemoService> invoker = new DubboInvoker<DemoService>(DemoService.class,
registryUrl, new ExchangeClient[]{new MockedClient("10.20.20.20", 2222, true)});
registryProtocol.export(invoker);
}
开发者ID:l1325169021,项目名称:github-test,代码行数:12,代码来源:RegistryProtocolTest.java
示例5: refer
import com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker; //导入依赖的package包/类
public <T> Invoker<T> refer(Class<T> serviceType, URL url) throws JahhanException {
// modified by lishen
optimizeSerialization(url);
// create rpc invoker.
DubboInvoker<T> invoker = new DubboInvoker<T>(serviceType, url, getClients(url), invokers);
invokers.add(invoker);
return invoker;
}
开发者ID:nince-wyj,项目名称:jahhan,代码行数:11,代码来源:DubboProtocol.java
注:本文中的com.alibaba.dubbo.rpc.protocol.dubbo.DubboInvoker类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论