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

Automatical updating of META-INF/services with annotations #506

Open
Voycawojka opened this issue Nov 6, 2019 · 1 comment
Open

Automatical updating of META-INF/services with annotations #506

Voycawojka opened this issue Nov 6, 2019 · 1 comment
Labels
beginner A simple task perfect for beginners help wanted

Comments

@Voycawojka
Copy link

Voycawojka commented Nov 6, 2019

Is your feature request related to a problem? Please describe.
It's very easy to forget about updating META-INF/services for ServiceLoader every time HandlerFactory or ActionFactory is created/deleted.

Describe the solution you'd like
An annotation could be used to automaticaly detect factories. One existing solution is Google's AutoService. Using it with Knot.x would look like this:

@AutoService(HandlerFactory.class)
class MyHandlerFactory implements HandlerFactory {
  // …
}

No need to manually update the META-INF. Same for action factories.

Describe alternatives you've considered
Custom Knot.x annotations could be developed, but it would require a lot more work to do.

@Mateusz512
Copy link

Mateusz512 commented Nov 6, 2019

Also please consider creating an annotation for getName method

@AutoService(Action.class)
@Name("my-custom-action")
class MyAction implements Action {
  // …
}

@malaskowski malaskowski added beginner A simple task perfect for beginners help wanted labels Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner A simple task perfect for beginners help wanted
Projects
None yet
Development

No branches or pull requests

3 participants