dubbo
dubbo copied to clipboard
dubbo-compatible @SPI interface compatible not work
- Dubbo version: 2.7.7
EG:
SPI interface in apache dubbo
package org.apache.dubbo.common.extension;
/**
* ExtensionFactory
*/
@SPI
public interface ExtensionFactory {
...
}
compatible class with alibaba dubbo
package com.alibaba.dubbo.common.extension;
@Deprecated
public interface ExtensionFactory extends org.apache.dubbo.common.extension.ExtensionFactory {
}
Not ADD @SPI annotation
public static <T> ExtensionLoader<T> getExtensionLoader(Class<T> type) {
.....
if (!withExtensionAnnotation(type)) {
throw new IllegalArgumentException("Extension type (" + type +
") is not an extension, because it is NOT annotated with @" + SPI.class.getSimpleName() + "!");
}
....
return loader;
}
In ExtensionLoader#getExtensionLoader will check failed and throw Exception.
BTW, ExtensionLoader not provided compatible class.
Not ADD @SPI annotation
I've added @SPI to alibaba.ExtensionFactory in #6436
BTW, ExtensionLoader not provided compatible class.
Why do we need a compatible ExtensionLoader, could you please further explain?