Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dubbo-compatible @SPI interface compatible not work #6428

Closed
imsunv opened this issue Jul 8, 2020 · 1 comment · Fixed by #6436
Closed

dubbo-compatible @SPI interface compatible not work #6428

imsunv opened this issue Jul 8, 2020 · 1 comment · Fixed by #6436
Assignees
Milestone

Comments

@imsunv
Copy link
Contributor

imsunv commented Jul 8, 2020

  • 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.

@chickenlj chickenlj added this to the 2.7.9 milestone Jul 8, 2020
@chickenlj chickenlj self-assigned this Jul 8, 2020
@chickenlj chickenlj modified the milestones: 2.7.9, 2.7.8 Jul 8, 2020
@chickenlj
Copy link
Contributor

chickenlj commented Jul 8, 2020

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?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants