![JAR search and dependency download from the Maven repository](/logo.png)
com.reger.dubbo.annotation.Inject Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-boot-starter-dubbo Show documentation
Show all versions of spring-boot-starter-dubbo Show documentation
本项目是spring-boot与dubbo有机结合的桥梁,根据spring-boot开箱即用的原则实现,使dubbo的使用变得及其简单快捷,容易上手。让dubbo小白正常使用dubbo,只需一盏茶的功夫。
package com.reger.dubbo.annotation;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import com.alibaba.dubbo.config.annotation.Reference;
/**
* 该注解会优先使用spring上下文找到的对象注入当前参数,如果spring上下文找不到时才会到dubbo中找并注入当前注解的参数
* @author leige
*
*/
@Retention(RUNTIME)
@Target({ FIELD, METHOD })
public @interface Inject {
/**
* 该参数只对从spring容器注入bean生效
* @return 需要注入的beanName
*/
String name() default "";
/**
* 如果从spring容器没有能够找到的话,使用该配置到dubbo中找
* @return dubbo的注入参数
*/
Reference value() default @Reference();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy