Java Code Examples for com.alibaba.dubbo.config.annotation.Reference#application()

The following examples show how to use com.alibaba.dubbo.config.annotation.Reference#application() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DubboConsumerAutoConfiguration.java    From dubbo-spring-boot-starter with Apache License 2.0 5 votes vote down vote up
/**
 * init consumer bean
 *
 * @param interfaceClazz interfaceClazz
 * @param reference reference
 * @return ReferenceBean<T>
 * @throws BeansException BeansException
 */
private <T> ReferenceBean<T> getConsumerBean(String beanName, Field field, Reference reference)
    throws BeansException {
  ReferenceBean<T> referenceBean = new ReferenceBean<T>(reference);
  if ((reference.interfaceClass() == null || reference.interfaceClass() == void.class)
      && (reference.interfaceName() == null || "".equals(reference.interfaceName()))) {
    referenceBean.setInterface(field.getType());
  }

  Environment environment = this.applicationContext.getEnvironment();
  String application = reference.application();
  referenceBean.setApplication(this.parseApplication(application, this.properties, environment,
      beanName, field.getName(), "application", application));
  String module = reference.module();
  referenceBean.setModule(this.parseModule(module, this.properties, environment, beanName,
      field.getName(), "module", module));
  String[] registries = reference.registry();
  referenceBean.setRegistries(this.parseRegistries(registries, this.properties, environment,
      beanName, field.getName(), "registry"));
  String monitor = reference.monitor();
  referenceBean.setMonitor(this.parseMonitor(monitor, this.properties, environment, beanName,
      field.getName(), "monitor", monitor));
  String consumer = reference.consumer();
  referenceBean.setConsumer(this.parseConsumer(consumer, this.properties, environment, beanName,
      field.getName(), "consumer", consumer));

  referenceBean.setApplicationContext(DubboConsumerAutoConfiguration.this.applicationContext);
  return referenceBean;
}
 
Example 2
Source File: ReferenceBeanBuilder.java    From dubbo-2.6.5 with Apache License 2.0 4 votes vote down vote up
@Override
protected String resolveApplicationConfigBeanName(Reference annotation) {
    return annotation.application();
}