Annotation Type Adaptive


@Documented @Retention(RUNTIME) @Target({TYPE,METHOD}) public @interface Adaptive
Provide helpful information for ExtensionLoader to inject dependency extension instance.
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Decide which target extension to be injected.
  • Element Details

    • 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's SPI).

      For example, given String[] {"key1", "key2"}:

      1. find parameter 'key1' in URL, use its value as the extension's name
      2. try 'key2' for extension's name if 'key1' is not found (or its value is empty) in URL
      3. use default extension if 'key2' doesn't exist either
      4. otherwise, throw IllegalStateException
      If the parameter names are empty, then a default parameter 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, for org.apache.dubbo.xxx.YyyInvokerWrapper, the generated name is String[] {"yyy.invoker.wrapper"}.
      Returns:
      parameter names in URL
      Default:
      {}