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

WIP: Add annotation to register scope contexts #40616

Closed
wants to merge 2 commits into from

Conversation

sixcorners
Copy link

Think it would be nice if I could register a context at build time without creating an extension?

@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label May 14, 2024
@sixcorners
Copy link
Author

Also what about making InjectableContext.destroy() call InjectableContext.destroy(ContextState)?

@sixcorners
Copy link
Author

sixcorners commented May 16, 2024

nevermind. I see now that I can just define a ComponentsProvider to register these things. Neato!

import org.kohsuke.MetaInfServices;

@MetaInfServices
public class MyComponentsProvider implements ComponentsProvider {
  @Override
  public Components getComponents() {
    return new Components(
        List.of(),
        List.of(),
        List.of(new MyContext()),
        Set.of(),
        Map.of(),
        List::of,
        Map.of(),
        Set.of(),
        Map.of());
  }
}

@sixcorners sixcorners closed this May 16, 2024
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) triage/invalid This doesn't seem right
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant