kennychou0529 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

GCal bundle does not start up correctly if activated before it is properly configured #371

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use latest 1.3.0-SNAPSHOT build and start up several times (see 
https://groups.google.com/forum/#!searchin/openhab/services$20not/openhab/QJVsNH
r4yk4/Sx3yeD6qIXwJ)

Please provide any additional information below.

This is very likely due to the new Felix FileInstall.
In issue 141, I have refactored the active bindings, but the GCal bundle needs 
a bigger refactoring, so I create this dedicated issue for it.

Note: If the GCalEventDownloader is activated before GCalConfiguration.update() 
was called, the start() method of the service will immediately return as 
isProperlyConfigured is false at that time.

To fix this problem, the bundle must actively start the service once the 
configuration is complete. In the active bindings I have solved this by 
replacing the (passive) isProperlyConfigured() by an (active) 
setProperlyConfigured(), which needs to be called from within the updated() 
method. As the GcalConfiguration is implemented with static fields with no 
connection to the GCal services, this wasn't easy to fix. I suggest a 
refactoring in a way that the services themselves become ManagedServices.

Original issue reported on code.google.com by kai.openhab on 8 Jul 2013 at 8:12

GoogleCodeExporter commented 9 years ago

Original comment by teichsta on 9 Jul 2013 at 9:02

GoogleCodeExporter commented 9 years ago
fixed in 
https://code.google.com/p/openhab/source/detail?r=1d3911ae1890373f304440392b2418
45d27f5bc1

Original comment by teichsta on 10 Jul 2013 at 9:31