April 27, 2020
Estimated Post Reading Time ~

How to get all the configurations from a configurationFactory - AEM

@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY, policy = ReferencePolicy.STATIC)
private ConfigurationAdmin configAdmin;
try {
Configuration[] confArray = configAdmin.listConfigurations("(service.factoryPid= com.service.config.impl.ConfigFactoryServiceImpl)");

//Retrieve the configurations - Iterate through confArray
final Configuration conf = confArray[0];
final String property1 = (String) conf.getProperties().get("property1");

} catch (Exception e) {

}

service.factoryPid:



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.