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

Backwards Compatible Generic Modules #567

Merged
merged 6 commits into from
May 16, 2024

Conversation

SentryMan
Copy link
Collaborator

Adds all the backwards compatibility stuff from #566 minus the SPI changes

@SentryMan SentryMan self-assigned this May 14, 2024
@SentryMan SentryMan requested a review from rbygrave May 14, 2024 03:29
@SentryMan SentryMan added enhancement New feature or request refactor labels May 14, 2024
@SentryMan SentryMan added this to the 10.0 milestone May 14, 2024
ServiceLoader.load(Module.class, newClassLoader).forEach(avajeModules::add);
ServiceLoader.load(AvajeModule.class, newClassLoader).stream()
.map(Provider::get)
.filter(AvajeModule.class::isInstance)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems interesting

@rbygrave rbygrave self-requested a review May 14, 2024 11:08
Copy link
Contributor

@rbygrave rbygrave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to resolve why InjectPlugin exists

@rbygrave
Copy link
Contributor

Did you hit this issue of desiring 10.x to be backwards compatible or did someone else? Just wondering of the pain level. Also just to say I'm kind of not loving "AvajeModule" as a name ... so I'm hoping that something better might come to me.

@SentryMan
Copy link
Collaborator Author

Yeah, I noticed that all the plugins and libraries I've made at work ceased to function

@SentryMan
Copy link
Collaborator Author

Need to resolve why InjectPlugin exists

The maven plugin/generator is unable to get the type array from legacy plugins.

@SentryMan SentryMan requested a review from rbygrave May 15, 2024 12:24
@SentryMan
Copy link
Collaborator Author

SentryMan commented May 15, 2024

don't like "AvajeModule" as a name

I was thinking of AvajeModule sort of like Guice has GuiceModule.

I got a couple of alternate options (just spitballing here):

  • BeanModule
  • DIModule
  • ScopeModule
  • GraphModule
  • WiringModule
  • DependencyModule

@rob-bygrave
Copy link
Contributor

AvajeModule sort of like Guice has GuiceModule

Yeah, that makes sense. IMO the original "Module" was a poor choice by me. "InjectModule" is taken by the annotation (which seems ok) ... so I'm definately warming to AvajeModule (it's mostly used internally).

I should get to review this again today. Great work by the way !!!

@rbygrave rbygrave merged commit 975dc30 into avaje:master May 16, 2024
4 checks passed
@rbygrave rbygrave linked an issue May 16, 2024 that may be closed by this pull request
@SentryMan SentryMan deleted the backwards-compatibility branch May 17, 2024 03:18
rbygrave added a commit that referenced this pull request May 26, 2024
Restore the Module interface to use Class<?> as per 9.x
The AvajeModule interface changes this to Type
rbygrave added a commit that referenced this pull request May 26, 2024
…575)

Restore the Module interface to use Class<?> as per 9.x
The AvajeModule interface changes this to Type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce Service Loader Invocations
3 participants