Thank you Gert!

Sorry for the late reply ...

I am able to implement BundleContextAware to access the properties. I am
going to try your suggestion.


Code snippet of my class ...
public class MyRouteBuilder extends RouteBuilder implements
BundleContextAware{

 BundleContext context = null;

 public void setBundleContext(final BundleContext bundleContext) // comes
from BundleContextAware
     {
                this.context = bundleContext;
        }

 public void updateProperties() throws Exception {

                                 ServiceReference ref =
context.getServiceReference(ConfigurationAdmin.class.getName());
                         ConfigurationAdmin cs = (ConfigurationAdmin)
context.getService(ref);

                        Configuration conf =
cs.getConfiguration("org.apache.servicemix.examples", null);
                             Dictionary<Object, Object> props =
conf.getProperties();
                         if (props == null) {
                             props = new Properties();
                         }


                         props.put("hibernate.dialect",
"org.hibernate.dialect.HSQLDialect");
                         props.put("XYS", "fooo");
                         conf.update(props);

 }

-- 
View this message in context: 
http://servicemix.396122.n5.nabble.com/How-do-I-read-the-property-values-from-ConfigurationAdmin-for-a-PID-from-camel-code-tp512223p1045099.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to