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

Unify plugin builders and plugin factories

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.2
    • 3.0.0
    • Plugins
    • None

    Description

      Before we can even settle on a preferred way to create plugins reflectively, it would be nice to combine the PluginAttribute and PluginBuilderAttribute annotations. In fact, allowing for flexibility in dependency injection for creating plugins would be better than strictly allowing factory methods or builder classes only. For instance, setter methods could be annotated for injection which allows for further customization.

      Since the ability to reflect on a parameter to get its name wasn't added until Java 1.8 (and alternatives require using bytecode libraries like asm), it would be nice to add some sort of plugin validation to the annotation processor to prevent users from forgetting to specify an attribute name when attached to a parameter instead of a field.

      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: