Improvement #259

Optionally block initialization of SimpleDriver while ConfigAdmin has not set values

Added by Philipp Buluschek about 4 years ago. Updated almost 4 years ago.

Status:Rejected Start date:09/28/2014
Priority:Low Due date:
Assignee:Stefano Lenzi % Done:


Category:zigbee.basedriver Spent time: -
Target version:org.aaloa.zb4osgi.zigbee.basedriver-0.8.0
Has a patch:No Has license agreement signed:No


Per default, the SimpleDriver instance is initialized with default values if no ConfigAdmin data has been set before. In effect, this means that the config admin must be started first.
OSGi recommends that the bundle start order be irrelevant. So it should be possible to force the SimpleDriver to wait for the config admin before initializing.
As this is not the current behavior, the default behavior should be equivalent of today, but the waiting must be forceable.

At this point of the execution, ConfigAdmin is not yet present, so this special behavior must be passed as a runtime config property on the command line (eg. -D...).

eg. java ... -Dit.cnr.isti.zigbee.driver.start.with.defaults=false


#1 Updated by Stefano Lenzi about 4 years ago

  • Category set to zigbee.basedriver
  • Status changed from New to Feedback
  • Assignee set to Stefano Lenzi
  • Priority changed from Normal to Low
  • Target version set to org.aaloa.zb4osgi.zigbee.basedriver-0.8.0

I'm going by memory but it seems to me that the SimpleDriver is initialized by ZigBee Base Driver which uses the Config Admin, and if there is no Config Admin on the system the ZigBee Base Driver will initialize the SimpleDriver with default parameters, whihc is exactly the behavior suggested by OSGi. Am I wrong?

Why do you need a "star.with.defaults" property? I would accept more the use of System Property with the same name of the property used with the Config Admin for setting new defaults for the ZigBee Base Driver

#2 Updated by Philipp Buluschek almost 4 years ago

Actually, I believe my original problem was that if the SimpleDriver gets opened with the default values (port="auto" etc), this blocked my system as RXTX couldn't find the port or couldn't reset the device (haven't debugged completely, so not sure).

My point is, that you need a config anyhow, so it should be possible to force BaseDriver to wait for a valid config from ConfigAdmin before opening the SimpleDriver.

#3 Updated by Stefano Lenzi almost 4 years ago

As far as I know starting the system with AUTO seems to work, but there is no way to wait for a valid configuration, if defaults are not good for a specific environment, then it is up to the developer to provide the right configuration, but there is no way to identify a valid configuration a priori.

If you need a system that start only when some particular event happen then it means that you should create your own bundle that manage the starting of bundles: ZigBee Interface Controller (aka the bundle registering the SimpleDriver) or the starting of ZigBee Base Driver

I would set this issue to "Rejected"

#4 Updated by Stefano Lenzi almost 4 years ago

  • Status changed from Feedback to Rejected

As no further feedback was given then, I will set this as rejected

Also available in: Atom PDF