Matt Sicker created LOG4J2-2852:
-----------------------------------

             Summary: Add plugin/bean scopes to unify object lifecycle 
management APIs
                 Key: LOG4J2-2852
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2852
             Project: Log4j 2
          Issue Type: Task
          Components: Core
            Reporter: Matt Sicker


In the 2.x plugin API, we implement a sort of ad hoc mechanism for lifecycle 
and instance management based on a plugin's category. For example, the "Core" 
category of plugins all map to lifecycles of a configuration file with each 
instance injected into a particular configuration node or nodes. Other plugins 
are created in other scopes, and some other code attempts to emulate singleton 
scopes via system properties and other similar indirections.

In 3.0, these APIs should be unified into a singular "scope" concept. This idea 
is modeled after the 
[Context|https://docs.jboss.org/cdi/api/2.0/javax/enterprise/context/spi/Context.html]
 API from CDI. A scope should control the lifecycle of a plugin instance which 
can be specified through an annotation. Example scopes that need to be 
supported include singleton, logger context, configuration, and dependent. The 
singleton and dependent scopes should behave analogously to their CDI contexts. 
The logger context and configuration scopes should be bound to the lifecycles 
of {{LoggerContext}} and {{Configuration}} respectively.



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

Reply via email to