Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2854

Create standardized dependency injection API

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0
    • Core
    • None

    Description

      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 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.

      Attachments

        Activity

          People

            mattsicker Matt Sicker
            mattsicker Matt Sicker
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: