Friday, 11 January 2013

Retrieve OSGI Configurations

Scenario: How to retrieve configuration details in jsp/class ?

Solutions

@Reference
    ConfigurationAdmin configAdmin;


Configuration config = configAdmin.getConfiguration("com.day.cq.mailer.DefaultMailService");
           
Dictionary<?, ?> d = config.getProperties();

log.debug("Configurations Dictionary:{}"+d);

String hostName= (String) d.get("smtp.host");



No comments:

Post a Comment