You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Matt Sicker (Jira)" <ji...@apache.org> on 2022/03/20 21:23:00 UTC

[jira] [Resolved] (LOG4J2-2853) Add plugin/bean qualifiers to unify instance selection for dependency injection

     [ https://issues.apache.org/jira/browse/LOG4J2-2853?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Sicker resolved LOG4J2-2853.
---------------------------------
    Fix Version/s: 3.0.0
       Resolution: Fixed

Merged in master.

> Add plugin/bean qualifiers to unify instance selection for dependency injection
> -------------------------------------------------------------------------------
>
>                 Key: LOG4J2-2853
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2853
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Matt Sicker
>            Assignee: Matt Sicker
>            Priority: Major
>             Fix For: 3.0.0
>
>
> In the 2.x plugin API, we have numerous ways of specifying metadata to a variable or performing manual configuration tree traversal in order to resolve the value of that variable from the user configuration. These include most of the {{@Plugin}} annotations as well as some system properties.
> In the 3.0 API, we should unify this into a "qualifier" concept. A plugin/bean can contain one or more qualifiers which are specified by annotations and matched at runtime to the injection target qualifiers. Qualifiers are inspired by the [corresponding concept in javax.inject|https://docs.oracle.com/javaee/6/api/javax/inject/Inject.html], though they shouldn't be limited to only one qualifier on an injection target or plugin/bean. Like in CDI, multiple qualifiers should be allowed to be specified.
> Within a scope (LOG4J2-2852), plugins/beans will have at most one instance per unique set of qualifiers. Qualifiers will typically be placed on plugin classes or on injection targets, while configuration trees will emit specially qualified plugins/beans for injection into Core plugins which take injected parameters. Existing plugin annotations should be updated to work as corresponding qualifiers without requiring code updates on the plugin side (even though this will allow us to simplify and clean up various parts of our own code base over time).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)