注释类型 Adaptive
-
@Documented @Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface Adaptive
Provide helpful information forExtensionLoader
to inject dependency extension instance.- 另请参阅:
ExtensionLoader
,URL
-
-
元素详细资料
-
value
String[] value
Decide which target extension to be injected. The name of the target extension is decided by the parameter passed in the URL, and the parameter names are given by this method.If the specified parameters are not found from
URL
, then the default extension will be used for dependency injection (specified in its interface'sSPI
).For examples, given
String[] {"key1", "key2"}
:- find parameter 'key1' in URL, use its value as the extension's name
- try 'key2' for extension's name if 'key1' is not found (or its value is empty) in URL
- use default extension if 'key2' doesn't appear either
- otherwise, throw
IllegalStateException
SPI
, then a name is generated from interface's class name with the rule: divide classname from capital char into several parts, and separate the parts with dot '.', for example: forcom.alibaba.dubbo.xxx.YyyInvokerWrapper
, its default name isString[] {"yyy.invoker.wrapper"}
. This name will be used to search for parameter from URL.- 返回:
- parameter key names in URL
- 默认值:
- {}
-
-