Matt Sicker created LOG4J2-2854:
-----------------------------------

             Summary: 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


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)

Reply via email to