You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Benson Margulies <be...@basistech.com> on 2016/08/10 21:02:01 UTC

Registering a ConfigurationListener

I see examples that seem to be just registering these as a service on
any old bundle. The javadoc says, "ConfigurationListener objects are
registered with the Framework service registry". Does that mean the
system bundle?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Registering a ConfigurationListener

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Wednesday 10 August 2016 19:46:05 Benson Margulies wrote:
> On Wed, Aug 10, 2016 at 5:44 PM, David Jencks
[...]
> > out of curiosity, why do you need your own ConfigurationListener?
> 
> Oh, it's the collision of two issues.
> 
> First, I need to have the arrangement of '.cfg' file make sense to a
> human being who is configuring a system, not just be a mirror of my
> momentary set of modularity decisions into @Component classes. So I
> can't use the DS connection to config-admin very well, since I need
> multiple objects to read the same configuration.
> 
> Second, purely in my tests, I was having trouble making sure that the
> config of one of these items was present _before_ its @Activate was
> called,

See my last mail in thread "Bundles needed to use DS/SCR" – pax-exam-cm 
ensures configurations are available before components get activated.

O.

> so I considered deferring the work until a
> ConfigurationListener was called back. When I registered it on the
> bundle at hand, it was never called. I probably registered it wrong.
> I've found a simpler approach.
> 
> > thanks
> > david jencks
[...]


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Registering a ConfigurationListener

Posted by Benson Margulies <be...@basistech.com>.
On Wed, Aug 10, 2016 at 5:44 PM, David Jencks
<da...@yahoo.com.invalid> wrote:
> I can’t think of any circumstances where you’d want to register with the system bundle, normally you’d register with the bundle interested in the configuration.  It won’t make any difference unless you are using framework hooks to control service visibility.  An example of where it would make a difference is if you installed a bunch of isolated subsystems each containing their own config admin implementation. Registering the listener with a bundle in one of these subsystems will make it visible only to that subsystem’s config admin.  Depending on how the isolation is set up registering with the system bundle is likely to make it invisible to all the subsystem config admins or possibly visible to all of them.
>

> out of curiosity, why do you need your own ConfigurationListener?

Oh, it's the collision of two issues.

First, I need to have the arrangement of '.cfg' file make sense to a
human being who is configuring a system, not just be a mirror of my
momentary set of modularity decisions into @Component classes. So I
can't use the DS connection to config-admin very well, since I need
multiple objects to read the same configuration.

Second, purely in my tests, I was having trouble making sure that the
config of one of these items was present _before_ its @Activate was
called, so I considered deferring the work until a
ConfigurationListener was called back. When I registered it on the
bundle at hand, it was never called. I probably registered it wrong.
I've found a simpler approach.



>
> thanks
> david jencks
>
>> On Aug 10, 2016, at 2:02 PM, Benson Margulies <be...@basistech.com> wrote:
>>
>> I see examples that seem to be just registering these as a service on
>> any old bundle. The javadoc says, "ConfigurationListener objects are
>> registered with the Framework service registry". Does that mean the
>> system bundle?
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Registering a ConfigurationListener

Posted by David Jencks <da...@yahoo.com.INVALID>.
I can’t think of any circumstances where you’d want to register with the system bundle, normally you’d register with the bundle interested in the configuration.  It won’t make any difference unless you are using framework hooks to control service visibility.  An example of where it would make a difference is if you installed a bunch of isolated subsystems each containing their own config admin implementation. Registering the listener with a bundle in one of these subsystems will make it visible only to that subsystem’s config admin.  Depending on how the isolation is set up registering with the system bundle is likely to make it invisible to all the subsystem config admins or possibly visible to all of them.

out of curiosity, why do you need your own ConfigurationListener?

thanks
david jencks

> On Aug 10, 2016, at 2:02 PM, Benson Margulies <be...@basistech.com> wrote:
> 
> I see examples that seem to be just registering these as a service on
> any old bundle. The javadoc says, "ConfigurationListener objects are
> registered with the Framework service registry". Does that mean the
> system bundle?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org