Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse SmartHome » Read conf files in binding(Read configurations files defined in conf folder)
Read conf files in binding [message #1729198] Tue, 12 April 2016 06:35 Go to next message
Harsh Choudhary is currently offline Harsh ChoudharyFriend
Messages: 3
Registered: April 2016
Junior Member
Hi

I know there is a ConfigurationAdmin OSGi service which can tell the properties defined in configuration files present in conf folder.

I want to read configuration in initialize() method of my binding. I do not want to register this as a separate service. Please help me achieving this goal.
Re: Read conf files in binding [message #1730096 is a reply to message #1729198] Thu, 21 April 2016 11:08 Go to previous messageGo to next message
Kai Kreuzer is currently offline Kai KreuzerFriend
Messages: 673
Registered: December 2011
Senior Member
You cannot directly get them in ThingHandler.initialize(), but you can get such configuration in the HandlerFactory.activate(). The Sonos binding does exactly that, see https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.sonos/src/main/java/org/eclipse/smarthome/binding/sonos/internal/SonosHandlerFactory.java#L53 and https://github.com/eclipse/smarthome/blob/master/extensions/binding/org.eclipse.smarthome.binding.sonos/ESH-INF/binding/binding.xml#L11.
Re: Read conf files in binding [message #1730186 is a reply to message #1730096] Fri, 22 April 2016 07:29 Go to previous message
Harsh Choudhary is currently offline Harsh ChoudharyFriend
Messages: 3
Registered: April 2016
Junior Member
That's great. Thanks.
Previous Topic:option list for a parameter doe not show values
Next Topic:PersistenceService
Goto Forum:
  


Current Time: Sat Apr 20 06:12:08 GMT 2024

Powered by FUDForum. Page generated in 0.03133 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top