com.alibaba.dubbo.config.annotation.Reference.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(172)

本文整理了Java中com.alibaba.dubbo.config.annotation.Reference.<init>方法的一些代码示例,展示了Reference.<init>的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Reference.<init>方法的具体详情如下:
包路径:com.alibaba.dubbo.config.annotation.Reference
类名称:Reference
方法名:<init>

Reference.<init>介绍

暂无

代码示例

代码示例来源:origin: alibaba/Sentinel

  1. /**
  2. * @author Eric Zhao
  3. */
  4. public class FooServiceConsumer {
  5. @Reference(url = "dubbo://127.0.0.1:25758", timeout = 3000)
  6. private FooService fooService;
  7. public String sayHello(String name) {
  8. return fooService.sayHello(name);
  9. }
  10. public String doAnother() {
  11. return fooService.doAnother();
  12. }
  13. }

代码示例来源:origin: spring-cloud-incubator/spring-cloud-alibaba

  1. /**
  2. * @author fangjian
  3. */
  4. public class FooServiceConsumer {
  5. @Reference(version = "${foo.service.version}", application = "${dubbo.application.id}",
  6. url = "dubbo://localhost:12345", timeout = 30000)
  7. private FooService fooService;
  8. public String hello(String name) {
  9. return fooService.hello(name);
  10. }
  11. }

代码示例来源:origin: wuyouzhuguli/SpringAll

  1. @RestController
  2. public class HelloController {
  3. @Reference
  4. private HelloService helloService;
  5. @GetMapping("/hello/{message}")
  6. public String hello(@PathVariable String message) {
  7. return this.helloService.hello(message);
  8. }
  9. }

代码示例来源:origin: apache/incubator-dubbo-spring-boot-project

  1. /**
  2. * Dubbo Registry ZooKeeper Consumer Bootstrap
  3. */
  4. @EnableAutoConfiguration
  5. public class DubboRegistryZooKeeperConsumerBootstrap {
  6. private final Logger logger = LoggerFactory.getLogger(getClass());
  7. @Reference(version = "${demo.service.version}")
  8. private DemoService demoService;
  9. @Bean
  10. public ApplicationRunner runner() {
  11. return args -> logger.info(demoService.sayHello("mercyblitz"));
  12. }
  13. public static void main(String[] args) {
  14. SpringApplication.run(DubboRegistryZooKeeperConsumerBootstrap.class).close();
  15. }
  16. }

代码示例来源:origin: apache/incubator-dubbo-spring-boot-project

  1. /**
  2. * Dubbo Externalized Configuration Consumer Bootstrap
  3. */
  4. @EnableAutoConfiguration
  5. public class DubboExternalizedConfigurationConsumerBootstrap {
  6. private final Logger logger = LoggerFactory.getLogger(getClass());
  7. @Reference(version = "${demo.service.version}", url = "${demo.service.url}")
  8. private DemoService demoService;
  9. @Bean
  10. public ApplicationRunner runner() {
  11. return args -> logger.info(demoService.sayHello("mercyblitz"));
  12. }
  13. public static void main(String[] args) {
  14. SpringApplication.run(DubboExternalizedConfigurationConsumerBootstrap.class).close();
  15. }
  16. }

代码示例来源:origin: jmdhappy/xxpay-master

  1. public class RpcCommonService {
  2. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  3. public IMchInfoService rpcMchInfoService;
  4. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  5. public IPayChannelService rpcPayChannelService;
  6. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  7. public IPayOrderService rpcPayOrderService;
  8. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  9. public IPayChannel4WxService rpcPayChannel4WxService;
  10. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  11. public IPayChannel4AliService rpcPayChannel4AliService;
  12. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  13. public INotifyPayService rpcNotifyPayService;
  14. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  15. public ITransOrderService rpcTransOrderService;
  16. @Reference(version = "1.0.0", timeout = 10000, retries = 0)
  17. public IRefundOrderService rpcRefundOrderService;

代码示例来源:origin: apache/incubator-dubbo-spring-boot-project

  1. /**
  2. * Dubbo Registry Nacos Consumer Bootstrap
  3. */
  4. @EnableAutoConfiguration
  5. public class DubboRegistryNacosConsumerBootstrap {
  6. private final Logger logger = LoggerFactory.getLogger(getClass());
  7. @Reference(version = "${demo.service.version}")
  8. private DemoService demoService;
  9. @Bean
  10. public ApplicationRunner runner() {
  11. return args -> logger.info(demoService.sayHello("mercyblitz"));
  12. }
  13. public static void main(String[] args) {
  14. SpringApplication.run(DubboRegistryNacosConsumerBootstrap.class).close();
  15. }
  16. }

代码示例来源:origin: apache/incubator-dubbo-spring-boot-project

  1. /**
  2. * Dubbo Auto Configuration Consumer Bootstrap
  3. *
  4. * @since 1.0.0
  5. */
  6. @EnableAutoConfiguration
  7. public class DubboAutoConfigurationConsumerBootstrap {
  8. private final Logger logger = LoggerFactory.getLogger(getClass());
  9. @Reference(version = "1.0.0", url = "dubbo://localhost:12345")
  10. private DemoService demoService;
  11. @Bean
  12. public ApplicationRunner runner() {
  13. return args -> logger.info(demoService.sayHello("mercyblitz"));
  14. }
  15. public static void main(String[] args) {
  16. SpringApplication.run(DubboAutoConfigurationConsumerBootstrap.class).close();
  17. }
  18. }

代码示例来源:origin: qiurunze123/miaosha

  1. @Reference
  2. @RequestMapping("/to_login")
  3. public String tologin(LoginVo loginVo, Model model) {
  4. logger.info(loginVo.toString());
  5. //未完成
  6. RedisLua.vistorCount(COUNTLOGIN);
  7. String count = RedisLua.getVistorCount(COUNTLOGIN).toString();
  8. logger.info("访问网站的次数为:{}",count);
  9. model.addAttribute("count",count);
  10. return "login";
  11. }

代码示例来源:origin: javahongxi/whatsmars

  1. /**
  2. * @author Eric Zhao
  3. */
  4. public class FooServiceConsumer {
  5. @Reference
  6. private FooService fooService;
  7. public String sayHello(String name) {
  8. return fooService.sayHello(name);
  9. }
  10. public String doAnother() {
  11. return fooService.doAnother();
  12. }
  13. }

代码示例来源:origin: rhwayfun/spring-boot-learning-examples

  1. /**
  2. * @author rhwayfun
  3. * @since 0.0.1
  4. */
  5. @Component
  6. public class DemoConsumer {
  7. @Reference(version = "1.0.0",
  8. application = "${dubbo.application.id}",
  9. url = "dubbo://localhost:20880")
  10. private DemoProvider demoProvider;
  11. public String sayHi(String name) {
  12. return demoProvider.sayHello(name);
  13. }
  14. }

代码示例来源:origin: javahongxi/whatsmars

  1. public class DemoRpc {
  2. @Reference
  3. private DemoService demoService;
  4. @Reference(registry = "otherRegistry")
  5. private OtherService otherService;

代码示例来源:origin: SpringCloud/spring-cloud-dubbo

  1. final class DefaultReferenceClass{
  2. // dubbo早与eureka启动 check设为false 调用时检查
  3. @Reference(check = false) String field;
  4. }

代码示例来源:origin: ctripcorp/apollo-use-cases

  1. @Component
  2. private static class ConsumerService {
  3. @Reference
  4. private DemoService demoService;
  5. public String sayHello(String message) {
  6. return demoService.sayHello(message);
  7. }
  8. }
  9. }

代码示例来源:origin: remoting/dubbox

  1. /**
  2. * @author dylan
  3. */
  4. @Component("aopAnnotationAction")
  5. public class AopAnnotationAction {
  6. @Reference
  7. private AopAnnotationService annotationService;
  8. public String doSayHello(String name) {
  9. return annotationService.sayHello(name);
  10. }
  11. }

代码示例来源:origin: wxyyxc1992/Backend-Boilerplates

  1. /**
  2. * @author xiaofei.wxf(teaey)
  3. * @since 0.0.0
  4. */
  5. @Component
  6. public class AbcService {
  7. @Reference(version = "1.0.0")
  8. public EchoService echoService;
  9. }

代码示例来源:origin: apache/incubator-dubbo-samples

  1. @Component("annotatedConsumer")
  2. public class GreetingServiceConsumer {
  3. @Reference
  4. private GreetingService greetingService;
  5. public String doSayHello(String name) {
  6. return greetingService.sayHello(name);
  7. }
  8. }

代码示例来源:origin: remoting/dubbox

  1. /**
  2. * AnnotationAction
  3. *
  4. * @author william.liangf
  5. */
  6. @Component("annotationAction")
  7. public class AnnotationAction {
  8. @Reference
  9. private AnnotationService annotationService;
  10. public String doSayHello(String name) {
  11. return annotationService.sayHello(name);
  12. }
  13. }

代码示例来源:origin: Athlizo/dubbo-spring-boot-starter

  1. /**
  2. * Created by Administrator on 2017/2/28/028.
  3. */
  4. @Component
  5. public class ConsumerAction {
  6. @Reference
  7. private DemoApi demoApi;
  8. public void add(int a, int b) {
  9. System.out.println("ret = " + demoApi.add(a, b));
  10. }
  11. }

代码示例来源:origin: YunaiV/oceans

  1. @RestController
  2. @RequestMapping("/item_category")
  3. public class ItemCategoryController {
  4. @Reference
  5. private ItemCategoryService itemCategoryService;
  6. @PermitAll
  7. @GetMapping("/list")
  8. public List<ItemCategorySimpleDTO> list() {
  9. return itemCategoryService.getEnabledSimpleList();
  10. }
  11. }

相关文章