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

Update DI system with DSL for configuring bindings #2147

Closed
jvz opened this issue Jan 1, 2024 · 1 comment · Fixed by #2148
Closed

Update DI system with DSL for configuring bindings #2147

jvz opened this issue Jan 1, 2024 · 1 comment · Fixed by #2148
Assignees
Labels
api Affects the public API plugins Affects the plugin system
Milestone

Comments

@jvz
Copy link
Member

jvz commented Jan 1, 2024

I first came up with this idea while working out how to remove the need for loading classes from an unknown ClassLoader that I needed a couple updates to the DI system:

  • Add a @TestBinding repeatable annotation for making it easy to register custom test bindings for a test. As it stands now, the only way test bindings could be specified was via methods on the test class to register said class as a bundle. This approach does not work with tests that use constructor injection for JUnit extension-provided arguments, thus requiring a different mechanism for test bindings. This should clean up the various test extension code in log4j-core-test.
  • Add a DSL to DI to make it simpler to register bindings that are registered either before or after the list of ConfigurableInstanceFactoryPostProcessor services are invoked.

Since the original branch for that code spiraled into a tangent branch, I'm breaking up the changes there into relevant pieces.

@jvz jvz added api Affects the public API plugins Affects the plugin system labels Jan 1, 2024
@jvz jvz added this to the 3.0.0 milestone Jan 1, 2024
@jvz jvz self-assigned this Jan 1, 2024
jvz added a commit to jvz/logging-log4j2 that referenced this issue Jan 2, 2024
- `DI.FactoryBuilder` and related builder classes for configuring a `ConfigurableInstanceFactory`.
- Repeatable `@TestBinding` test annotation for specifying simple bindings in tests.
- `@LegacyLoggerContextSource` test annotation for specifying v1-style configuration files.
- Test extension updates to improve compatibility of different annotations.

Related to apache#2147

Signed-off-by: Matt Sicker <mattsicker@apache.org>
@jvz jvz linked a pull request Jan 2, 2024 that will close this issue
jvz added a commit to jvz/logging-log4j2 that referenced this issue Jan 2, 2024
@jvz
Copy link
Member Author

jvz commented Jan 2, 2024

Completed

@jvz jvz closed this as completed Jan 2, 2024
@ppkarwasz ppkarwasz modified the milestones: 3.0.0, 3.0.0-beta2 Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Affects the public API plugins Affects the plugin system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants