注释类型 SPI
-
@Documented @Retention(RUNTIME) @Target(TYPE) public @interface SPI
Marker for extension interface Changes on extension configuration file
UseProtocolas an example, its configuration file 'META-INF/dubbo/com.xxx.Protocol' is changed from:
com.foo.XxxProtocol com.foo.YyyProtocolto key-value pair
xxx=com.foo.XxxProtocol yyy=com.foo.YyyProtocol
The reason for this change is:If there's third party library referenced by static field or by method in extension implementation, its class will fail to initialize if the third party library doesn't exist. In this case, dubbo cannot figure out extension's id therefore cannot be able to map the exception information with the extension, if the previous format is used.
For example:Fails to load Extension("mina"). When user configure to use mina, dubbo will complain the extension cannot be loaded, instead of reporting which extract extension implementation fails and the extract reason.
-
-
可选元素概要
可选元素 修饰符和类型 可选元素 说明 ExtensionScopescopescope of SPI, default value is application scope.Stringvaluedefault extension name
-
-
-
元素详细资料
-
value
String value
default extension name- 默认值:
- ""
-
-
-
scope
ExtensionScope scope
scope of SPI, default value is application scope.- 默认值:
- org.apache.dubbo.common.extension.ExtensionScope.APPLICATION
-
-