Details

    • Sub-task
    • Resolution: Done
    • Optional
    • 5.10.0.Final
    • 5.9.8.Final
    • Configuration
    • None

    Description

      Narayana has quite a flexible mechanism for setting properties:

      • it uses xml property files
      • it reads Java system properties
      • it initialises our config beans using reflection to call the setters

      Some systems, Quarkus for example, have their own config mechanisms (MicroProfile Config in the Quarkus example) so it makes sense to allow our beans to be configured directly (avoiding parsing and reflection).

      Implementation wise we do already have the PropertiesFactory class to directly provide config properties but that code still uses reflection to set the actual property values and besides, it is an abstract class so we cannot safely add new methods to it. My proposal is to add a single method to the BeanPopulator class:

          public static void setBeanInstance(String name, Object beanInstance) {
              beanInstances.putIfAbsent(name, beanInstance);
          }
      

      This code avoids the use of reflection (and possibly xml parsing) whenever access to the named bean is required. Note that this approach requires a user to know in advance which environment beans Narayana is using.

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-mmusgrov Michael Musgrove
              rhn-engineering-mmusgrov Michael Musgrove
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: