本文整理了Java中com.alibaba.dubbo.config.annotation.Reference.<init>
方法的一些代码示例,展示了Reference.<init>
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.<init>
方法的具体详情如下:
包路径:com.alibaba.dubbo.config.annotation.Reference
类名称:Reference
方法名:<init>
暂无
代码示例来源:origin: alibaba/Sentinel
/**
* @author Eric Zhao
*/
public class FooServiceConsumer {
@Reference(url = "dubbo://127.0.0.1:25758", timeout = 3000)
private FooService fooService;
public String sayHello(String name) {
return fooService.sayHello(name);
}
public String doAnother() {
return fooService.doAnother();
}
}
代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba
/**
* @author fangjian
*/
public class FooServiceConsumer {
@Reference(version = "${foo.service.version}", application = "${dubbo.application.id}",
url = "dubbo://localhost:12345", timeout = 30000)
private FooService fooService;
public String hello(String name) {
return fooService.hello(name);
}
}
代码示例来源:origin: wuyouzhuguli/SpringAll
@RestController
public class HelloController {
@Reference
private HelloService helloService;
@GetMapping("/hello/{message}")
public String hello(@PathVariable String message) {
return this.helloService.hello(message);
}
}
代码示例来源:origin: apache/incubator-dubbo-spring-boot-project
/**
* Dubbo Registry ZooKeeper Consumer Bootstrap
*/
@EnableAutoConfiguration
public class DubboRegistryZooKeeperConsumerBootstrap {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Reference(version = "${demo.service.version}")
private DemoService demoService;
@Bean
public ApplicationRunner runner() {
return args -> logger.info(demoService.sayHello("mercyblitz"));
}
public static void main(String[] args) {
SpringApplication.run(DubboRegistryZooKeeperConsumerBootstrap.class).close();
}
}
代码示例来源:origin: apache/incubator-dubbo-spring-boot-project
/**
* Dubbo Externalized Configuration Consumer Bootstrap
*/
@EnableAutoConfiguration
public class DubboExternalizedConfigurationConsumerBootstrap {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Reference(version = "${demo.service.version}", url = "${demo.service.url}")
private DemoService demoService;
@Bean
public ApplicationRunner runner() {
return args -> logger.info(demoService.sayHello("mercyblitz"));
}
public static void main(String[] args) {
SpringApplication.run(DubboExternalizedConfigurationConsumerBootstrap.class).close();
}
}
代码示例来源:origin: jmdhappy/xxpay-master
public class RpcCommonService {
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public IMchInfoService rpcMchInfoService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public IPayChannelService rpcPayChannelService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public IPayOrderService rpcPayOrderService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public IPayChannel4WxService rpcPayChannel4WxService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public IPayChannel4AliService rpcPayChannel4AliService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public INotifyPayService rpcNotifyPayService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public ITransOrderService rpcTransOrderService;
@Reference(version = "1.0.0", timeout = 10000, retries = 0)
public IRefundOrderService rpcRefundOrderService;
代码示例来源:origin: apache/incubator-dubbo-spring-boot-project
/**
* Dubbo Registry Nacos Consumer Bootstrap
*/
@EnableAutoConfiguration
public class DubboRegistryNacosConsumerBootstrap {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Reference(version = "${demo.service.version}")
private DemoService demoService;
@Bean
public ApplicationRunner runner() {
return args -> logger.info(demoService.sayHello("mercyblitz"));
}
public static void main(String[] args) {
SpringApplication.run(DubboRegistryNacosConsumerBootstrap.class).close();
}
}
代码示例来源:origin: apache/incubator-dubbo-spring-boot-project
/**
* Dubbo Auto Configuration Consumer Bootstrap
*
* @since 1.0.0
*/
@EnableAutoConfiguration
public class DubboAutoConfigurationConsumerBootstrap {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Reference(version = "1.0.0", url = "dubbo://localhost:12345")
private DemoService demoService;
@Bean
public ApplicationRunner runner() {
return args -> logger.info(demoService.sayHello("mercyblitz"));
}
public static void main(String[] args) {
SpringApplication.run(DubboAutoConfigurationConsumerBootstrap.class).close();
}
}
代码示例来源:origin: qiurunze123/miaosha
@Reference
@RequestMapping("/to_login")
public String tologin(LoginVo loginVo, Model model) {
logger.info(loginVo.toString());
//未完成
RedisLua.vistorCount(COUNTLOGIN);
String count = RedisLua.getVistorCount(COUNTLOGIN).toString();
logger.info("访问网站的次数为:{}",count);
model.addAttribute("count",count);
return "login";
}
代码示例来源:origin: javahongxi/whatsmars
/**
* @author Eric Zhao
*/
public class FooServiceConsumer {
@Reference
private FooService fooService;
public String sayHello(String name) {
return fooService.sayHello(name);
}
public String doAnother() {
return fooService.doAnother();
}
}
代码示例来源:origin: rhwayfun/spring-boot-learning-examples
/**
* @author rhwayfun
* @since 0.0.1
*/
@Component
public class DemoConsumer {
@Reference(version = "1.0.0",
application = "${dubbo.application.id}",
url = "dubbo://localhost:20880")
private DemoProvider demoProvider;
public String sayHi(String name) {
return demoProvider.sayHello(name);
}
}
代码示例来源:origin: javahongxi/whatsmars
public class DemoRpc {
@Reference
private DemoService demoService;
@Reference(registry = "otherRegistry")
private OtherService otherService;
代码示例来源:origin: SpringCloud/spring-cloud-dubbo
final class DefaultReferenceClass{
// dubbo早与eureka启动 check设为false 调用时检查
@Reference(check = false) String field;
}
代码示例来源:origin: ctripcorp/apollo-use-cases
@Component
private static class ConsumerService {
@Reference
private DemoService demoService;
public String sayHello(String message) {
return demoService.sayHello(message);
}
}
}
代码示例来源:origin: remoting/dubbox
/**
* @author dylan
*/
@Component("aopAnnotationAction")
public class AopAnnotationAction {
@Reference
private AopAnnotationService annotationService;
public String doSayHello(String name) {
return annotationService.sayHello(name);
}
}
代码示例来源:origin: wxyyxc1992/Backend-Boilerplates
/**
* @author xiaofei.wxf(teaey)
* @since 0.0.0
*/
@Component
public class AbcService {
@Reference(version = "1.0.0")
public EchoService echoService;
}
代码示例来源:origin: apache/incubator-dubbo-samples
@Component("annotatedConsumer")
public class GreetingServiceConsumer {
@Reference
private GreetingService greetingService;
public String doSayHello(String name) {
return greetingService.sayHello(name);
}
}
代码示例来源:origin: remoting/dubbox
/**
* AnnotationAction
*
* @author william.liangf
*/
@Component("annotationAction")
public class AnnotationAction {
@Reference
private AnnotationService annotationService;
public String doSayHello(String name) {
return annotationService.sayHello(name);
}
}
代码示例来源:origin: Athlizo/dubbo-spring-boot-starter
/**
* Created by Administrator on 2017/2/28/028.
*/
@Component
public class ConsumerAction {
@Reference
private DemoApi demoApi;
public void add(int a, int b) {
System.out.println("ret = " + demoApi.add(a, b));
}
}
代码示例来源:origin: YunaiV/oceans
@RestController
@RequestMapping("/item_category")
public class ItemCategoryController {
@Reference
private ItemCategoryService itemCategoryService;
@PermitAll
@GetMapping("/list")
public List<ItemCategorySimpleDTO> list() {
return itemCategoryService.getEnabledSimpleList();
}
}
内容来源于网络,如有侵权,请联系作者删除!