[ 
https://issues.apache.org/jira/browse/ARTEMIS-3627?focusedWorklogId=714543&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-714543
 ]

ASF GitHub Bot logged work on ARTEMIS-3627:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jan/22 14:58
            Start Date: 25/Jan/22 14:58
    Worklog Time Spent: 10m 
      Work Description: gemmellr commented on a change in pull request #3928:
URL: https://github.com/apache/activemq-artemis/pull/3928#discussion_r791798013



##########
File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/uri/BeanSupport.java
##########
@@ -35,18 +35,27 @@
 public class BeanSupport {
 
    private static final BeanUtilsBean beanUtils = new BeanUtilsBean();
+   private static final Map<Converter, Class> customConverters = new 
HashMap<>();
 
    static {
-      // This is to customize the BeanUtils to use Fluent Proeprties as well
+      // This is to customize the BeanUtils to use Fluent Properties as well
       beanUtils.getPropertyUtils().addBeanIntrospector(new 
FluentPropertyBeanIntrospectorWithIgnores());
    }
 
    public static void registerConverter(Converter converter, Class type) {
       synchronized (beanUtils) {
          beanUtils.getConvertUtils().register(converter, type);
+         customConverters.put(converter, type);
       }
    }
 
+   public static void customise(BeanUtilsBean bean) {
+      for (Map.Entry<Converter, Class> existing : customConverters.entrySet()) 
{
+         bean.getConvertUtils().register(existing.getKey(), 
existing.getValue());
+      }

Review comment:
       The other customConverters usage is synchronized, so this probably 
should be also.
   
   Could be nicer with:
   ```
         customConverters.forEach((key, value) -> {
            bean.getConvertUtils().register(key, value);
         });
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 714543)
    Time Spent: 4h  (was: 3h 50m)

> Allow properties to configure 'new' broker attributes and load from a file
> --------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3627
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3627
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Configuration
>    Affects Versions: 2.20.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 2.21.0
>
>          Time Spent: 4h
>  Remaining Estimate: 0h
>
> Following up onĀ ARTEMIS-851, where simple set attributes can be overridden 
> via system properties. This enhancement will allow properties to be loaded 
> from broker.properties and allow additions to lists and maps.
> The additions to the collections require some naming convention. Many of the 
> elements already support a name attribute and this can be used to locate and 
> or create new entries.
> The idea is that a plain broker can be augmented with the presence of a 
> properties file to add a new acceptor called "tcp" using properties of the 
> form:
> acceptorConfigurations.tcp.params.host=localhost
> acceptorConfigurations.tcp.params.port=61616



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to