Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How let OSGi (Config Admin) persist/reuse your configuration?

Tags:

I'm new to OSGi. My aim is to create a structure with the config admin, so you can enter a configuration, which will be reused after restarting the server.

While I have read the api and tried some samples, I thought this feature will be included by default.

My question to you: Is this possible at all and if yes: what have I to consider to get this functionality?

PS. I'm using Equinox

cheers chris

like image 941
ChrisBenyamin Avatar asked Aug 03 '09 12:08

ChrisBenyamin


People also ask

What does the configuration admin service in OSGi provide?

The Configuration Admin service is an important aspect of the deployment of an OSGi framework. It allows an Operator to configure deployed bundles. Configuring is the process of defining the configuration data for bundles and assuring that those bundles receive that data when they are active in the OSGi framework.

Which is a valid way of creating an OSGi service?

Service - OSGi components can be made as OSGi service by marking it with @Service annotation. When you mark a component as service, you could refer (call) this service from other osgi components. Components can refer/call (using container injection – @Reference) other services but not components.


1 Answers

Configuration entered into Configuration Admin Service is persisted by default. However note that each implementation of Config Admin Service persists the configuration in its own way.

Equinox Config Admin (org.eclipse.equinox.cm) stores the configuration data in the persistent storage area provided by the Framework. And that happens to be the "local bundle cache" directory by default for Equinox.

Therefore each time you wipe-out the bundle cache or uninstall/reinstall the Config Admin Service bundle your configuration data will be lost. Unfortunately there seems to be no easy way to explicitly change the configuration data storage location for Equinox Config Admin service (possible with Felix Configuration Admin Service).

like image 173
Pavol Juhos Avatar answered Oct 05 '22 14:10

Pavol Juhos