You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2021/06/20 00:18:00 UTC

[jira] [Commented] (LOG4J2-2854) Create standardized dependency injection API

    [ https://issues.apache.org/jira/browse/LOG4J2-2854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17366072#comment-17366072 ] 

ASF subversion and git services commented on LOG4J2-2854:
---------------------------------------------------------

Commit f7ea16edb33d6a6752575c2070574e011d8a8aee in logging-log4j2's branch refs/heads/mean-bean-machine from Matt Sicker
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=f7ea16e ]

Simplify reflection model and qualifiers matching

This refactors a few things in the LOG4J2-2854 APIs:

* Rearranged some packages
* Removed the MetaElement and ElementManager API to rely directly on native reflection APIs
* Ported tests from JUnit 4 to JUnit 5
* Added NamedAliases and alias providers
* Removed Variable and collapsed it into the plain Bean interface
* Replaced qualifiers with names and aliases
* Replaced default qualifier with an empty string name (empty string name cannot be directly used as a name as that indicates to derive the name from the program element usually)


> Create standardized dependency injection API
> --------------------------------------------
>
>                 Key: LOG4J2-2854
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2854
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: Core
>            Reporter: Matt Sicker
>            Assignee: Matt Sicker
>            Priority: Major
>
> In the 2.x plugin API, we do not have a generic dependency injection mechanism. We do have a similar system in Configuration for injection configuration data into Core plugins. There are other attempts at user configuration injection into other classes through system properties as well.
> In the 3.0 API, a more generic and unified dependency injection API should be provided. This should be analogous to how the [standard javax.inject API|https://docs.oracle.com/javaee/6/api/javax/inject/Inject.html] works. This should include a way to specify how a class can be instantiated through either {{@Inject}} on the constructor or {{@Produces}} on a method. The produces version should replace the existing methods of binding configuration data to the  {{@Plugin(Builder)Factory}} annotations. Combined with scopes (LOG4J2-2852) and qualifiers (LOG4J2-2853), this will allow for a lot of code in log4j-core to be refactored to remove boilerplate code related to object construction and lifecycle management.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)