Hi, I've done some testing, and it seems that updated(null) is called once, and when I delete the configuration file. So my service should handle its state itself, and warn clients that it is not ready yet.
Regards, Leen On Thu, Nov 18, 2010 at 5:32 PM, Wunden Tobias <[email protected]> wrote: > Hi Leen, > > in the activator, you could ask the service registry for the config admin > service and explicitly get the configuration from it, then using it to make a > call to the updated() method of the ManagedService interface yourself. > > Make sure to add a reference to the config admin, otherwise your service > might be started before it is available. The downside with that will be that > your service goes down when the ConfigurationAdminService does. > > Tobias > > On 18.11.2010, at 17:24, "Leen Toelen" <[email protected]> wrote: > >> Hi, >> >> I have some trouble understanding the correlation between FileInstall >> and ManagedServices. >> >> This is an activator: >> public void start(BundleContext context) throws Exception { >> MyImpl impl = new MyImpl(); //implements two interfaces, one of >> which managedservice >> >> Properties properties = new Properties(); >> properties.put(Constants.SERVICE_PID, "myservicepid"); >> String[] interfaces = { ManagedService.class.getName(), >> MyInterface.class.getName() }; >> context.registerService(interfaces, impl, properties); >> } >> >> and under my fileinstall managed directory I hava myservicepid.cfg >> with key-value pairs in it. >> >> The question is when the services are registered and available to listeners. >> - when the activator is started >> - after fileinstall is calls updated(Dictionary) on the ManagedService >> (using ConfigurationAdmin) >> >> should the implementation check whether is has been configured or not, >> or does felix do this for me? If not, is there a way to only register >> myImpl as "MyInterface" after it has been configured? >> >> Regards, >> Leen >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

