[
https://issues.apache.org/jira/browse/LOG4J2-598?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13963126#comment-13963126
]
Matt Sicker commented on LOG4J2-598:
------------------------------------
It would be more like a plugin builder. Essentially, using reflection, we could
find all the @PluginAttributes, @PluginElements, etc., inside a class. Then
we'd instantiate it using the default constructor. We could inject values into
fields either via direct reflection or by using the appropriate setFoo methods
(whichever was annotated); this is similar to how @Inject works in Java EE.
Then we can call an appropriately annotated method to create the object.
Basically, the main difference here is that the plugin gets instantiated by a
builder class instead of by a factory method. It's more object oriented and
similar to what a lot of Java developers are familiar with nowadays with
Spring's @Autowired annotation, CDI, EJB, etc.
> Support more data types in plugin attributes
> --------------------------------------------
>
> Key: LOG4J2-598
> URL: https://issues.apache.org/jira/browse/LOG4J2-598
> Project: Log4j 2
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0-rc1
> Reporter: Matt Sicker
> Assignee: Matt Sicker
> Priority: Minor
> Labels: annotations, plugins
>
> Currently, annotating plugin factory method parameters with
> {{@PluginAttribute}} only supports String types, but we use a lot of plugin
> attributes that could be automatically converted to primitive types. Now I'm
> not suggesting something as advanced as how Camel handles parameter injection
> (which does automatic non-trivial type conversion), but it would be great to
> support booleans, ints, longs, etc., to simplify quite a bit of extraneous
> string parsing.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]