1 Answers
How to read properties from OSGi configuration in AEM 6.1 WCMUse class
To read properties from OSGi configuration in an AEM 6.1 WCMUse class, you can follow these steps:
- Inject the Sling Configuration into your WCMUse class:
- Retrieve the Configuration object for your OSGi configuration:
- Access the properties using the Configuration object:
@Reference
private ConfigurationAdmin configurationAdmin;
Configuration configuration = configurationAdmin.getConfiguration("your.configuration.pid");
String propertyValue = configuration.getProperties().get("your.property.key").toString();
By following these steps, you can easily read properties from OSGi configurations in your AEM 6.1 WCMUse class. This allows you to leverage the power of OSGi configurations in your AEM projects.
Please login or Register to submit your answer