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

List all extension points and extensions for a plugin #207

Open
decebals opened this issue Apr 2, 2018 · 3 comments
Open

List all extension points and extensions for a plugin #207

decebals opened this issue Apr 2, 2018 · 3 comments

Comments

@decebals
Copy link
Member

decebals commented Apr 2, 2018

I think that it's nice to have a possibility to list all extension points and extensions that come with a plugin.
It's nice to have a kind of plugin's documentation created automatically.

@decebals
Copy link
Member Author

We have already this information (see LegacyExtensionStorage), all we have to do is write this information in the extensions.idx file.

@decebals
Copy link
Member Author

The first step in my opinion is to improve the format (content) of the extensions.idx file.
Now the format is very simple, with one extension id (class) on each line. As example I will present you the content of extensions.idx for the welcome plugin (see demo):

# Generated by PF4J
org.pf4j.demo.welcome.WelcomePlugin$WelcomeGreeting

My propose is to add also on the same line, the extension point(s) implemented by extension, separated by : as delimiter:

# Generated by PF4J
org.pf4j.demo.welcome.WelcomePlugin$WelcomeGreeting:org.pf4j.demo.api.Greeting

So, we have the extension (org.pf4j.demo.welcome.WelcomePlugin$WelcomeGreeting) and the extension point (org.pf4j.demo.api.Greeting) separated by : delimiter character.
The first big benefit is that we can avoid the reflection (time consuming) at runtime to discover the extension point(s) for an extension.
The second benefit is that we can create a nice documentation.

@decebals
Copy link
Member Author

To list all the extension points defined by a plugin, I think that we need a separate (probably) storage extension-points.idx. The format of the new file can be identical with the actual format of the extensions.idx, with one extension point id (class) on each line.
Other idea is to put this information (with all extension points) in the already existed extensions.idx.

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

No branches or pull requests

1 participant