You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/11/10 02:11:52 UTC

[GitHub] [dubbo] wangzhenxyz1 commented on a change in pull request #9187: bugfix ExtensionLoader can not inject by type properly.

wangzhenxyz1 commented on a change in pull request #9187:
URL: https://github.com/apache/dubbo/pull/9187#discussion_r746194390



##########
File path: dubbo-common/src/main/java/org/apache/dubbo/common/extension/Inject.java
##########
@@ -22,8 +22,20 @@
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
+import static org.apache.dubbo.common.extension.Inject.InjectType.ByName;
+
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ElementType.TYPE, ElementType.METHOD})
-public @interface DisableInject {
+public @interface Inject {
+    // whether enable injection or not
+    boolean enable() default true;
+
+    // inject type default by name injection
+    InjectType type() default ByName;
+
+    enum InjectType{
+        ByName,
+        ByType
+    }

Review comment:
       Hi AlbumenJ, DisableInject isn't generic, this Inject annotation is more generic, 
   then ExtensionLoader can't support inject by type,  so refactor it, that's all!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org