What is the process to read a property from OSGi configuration in AEM 6.1 in a WCMUse class?

1 Answers
Answered by suresh

How to Read a Property from OSGi Configuration in AEM 6.1 in a WCMUse Class

How to Read a Property from OSGi Configuration in AEM 6.1 in a WCMUse Class

When developing in AEM 6.1, you may need to read properties from the OSGi configuration in a WCMUse class. Follow the steps below to accomplish this:

  1. Inject the OSGi configuration service in the WCMUse class by using the @Reference annotation.
  2. Access the configuration properties using the Configuration object obtained from the configuration service.
  3. Read the specific property value using the getProperty() method of the Configuration object.
  4. Handle null or default values if necessary for robustness.

By following these steps, you can effectively read properties from the OSGi configuration in AEM 6.1 within a WCMUse class, ensuring a seamless development process.

Answer for Question: What is the process to read a property from OSGi configuration in AEM 6.1 in a WCMUse class?