On Sun, Feb 09, 2025 at 05:50:03PM +0000, Paul McCulloch wrote:
> Got you. It's frequently frustrated me that the config admin metatype
> default value can't be used to provide values in the absence of a
> configuration. I've just used constants to provide default property values
> that can be shared between components.
> 
> On Sun, 9 Feb 2025 at 16:37, Steinar Bang <s...@dod.no> wrote:
> 
> > >>>>> Paul McCulloch <pkmccull...@gmail.com>:
> >
> > > To create a configuration use the web or ssh console, or create the file
> > > no.priv.bang.authservice.config.cfg in /etc.
> >
> > Yes, I know.
> >
> > But what I tried to achieve (if possible) was to have one component
> > create and populate the file with defaults set in code if not present,
> > and use the configured values in the file if present, and then have a
> > different component use that same configuration.
> >
> > If possible... and it looks like it wasn't possible (or at least: not
> > possible without a lot of code).
> >
> > Anyway, both components are connected to the same database using
> > DataSource injections and I do the shared value setting in the database
> > (it was simpler for component #2, I could just add the config value to
> > the existing select to retrieve the config value from the database).
> >
> > (I'll post links to the code in question to this thread after it is
> > pushed. Can't be pushed yet because I have a dependency I have to
> > release to maven central first... or... it can be pushed but the CI will
> > break)
> >
> >

You can use the OSGi Configurator to create the configurations.

https://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.configurator.html

-- 
Chaz

Reply via email to