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

How to customize the plugin manager? #12

Closed
fabioformosa opened this issue Jun 18, 2020 · 3 comments
Closed

How to customize the plugin manager? #12

fabioformosa opened this issue Jun 18, 2020 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@fabioformosa
Copy link

I've tried to define a custom plugin manager

@Configuration
public class AppConfig {

    @Bean
    public SpringBootPluginManager pluginManager() {
        return new CustomPluginManager();
    }
   ...
}

public class CustomPluginManager extends SpringBootPluginManager {
 ...
}

and I got this error:

Caused by: java.lang.ClassCastException: class org.mypackage.CustomPluginManager cannot be cast
 to class org.laxture.sbp.SpringBootPluginManager (org.mypackage.CustomPluginManager is in 
unnamed module of loader 'app'; org.laxture.sbp.SpringBootPluginManager is in unnamed module 
of loader org.pf4j.PluginClassLoader @69228e85)

How can I define a CustomPluginManager that extends SpringBootPluginManager?

@hank-cp
Copy link
Owner

hank-cp commented Jun 19, 2020

org.laxture.sbp.SpringBootPluginManager is in unnamed module of loader org.pf4j.PluginClassLoader

this doesn't smell good, SpringBootPluginManager should be loaded by main classLoader. I will fork your poc project to demonstrate it and come back with a PR later.

@fabioformosa
Copy link
Author

fabioformosa commented Jun 19, 2020

Ok, you're very kind helping me. Yesterday I submitted in poc project also the branch feature/plugin-loader-for-springboot with an attempt to extend JarPluginLoader for executable springboot jar, but it suffers for the issue linked to SpringBootPluginManager override.

@hank-cp hank-cp added the help wanted Extra attention is needed label Jun 23, 2020
@hank-cp
Copy link
Owner

hank-cp commented Jun 23, 2020

see fabioformosa/sbp-pluggable-project#1

I know it's ugly, please see the reason

@hank-cp hank-cp closed this as completed Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants