You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by bokie <jm...@gmail.com> on 2013/10/20 21:21:26 UTC

Blueprint and ConfigAdmin

Hi,

I'm trying to get configuration to work with blueprint and I'm using Apache
Karaf 2.2.3 as the test platform. However, I'm not getting any call into my
update method of my "configurable" bean. My blueprint descriptor looks like
this:
===================================
<bean
  id="configurableBean"
  scope="singleton"
  activation="eager"
  class="test.blueprint.bean.ConfigurableBean"
  init-method="init"
  destroy-method="destroy">
  <cm:managed-properties
    persistent-id="test.blueprint.bean.configurable-bean"
    update-method="update"
    update-strategy="component-managed"/>
</bean>
===================================

and my ConfigurableBean class looks like this:
===================================
public final class ConfigurableBean {
  public void init() {}
  public void update(Map<String, String> properties) {}
  public void destroy() {}
}

I've also dropped a file name test.blueprint.bean.configurable-bean.cfg in
the ~/apache-karaf/2.3.3/etc directory.

Is my understanding of how this should work correct or am I missing
something?

Thanks,
Jorge







--
View this message in context: http://apache-felix.18485.x6.nabble.com/Blueprint-and-ConfigAdmin-tp5005672.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: Blueprint and ConfigAdmin

Posted by Felix Meschberger <fm...@adobe.com>.
Hi

Is it configurations deployed with such a file name in the FileInstall directory ? In this case I think FileInstall takes the „prefix“ before the dash as the factory PID and the „suffix“ after the dash as an alias for the factory configuration’s service PID.

Therefore you get the UUID-like service PID for the configuration and which is thus probably not supplied to some ManagedService. I would be supplied to a ManagedServiceFactory, though.

Regards
Felix

—
Felix Meschberger  |  Principal Scientist  |  Adobe



Am 27.10.2013 um 01:23 schrieb bokie <jm...@gmail.com>:

> If anyone runs into a similar problem here goes...
> 
> In my case the problem was due to the PID that I used
> (test.blueprint.bean.configurable-bean). The hyphen seems to cause some
> strange behaviour in karaf. I noticed, in karaf, that the command
> config:list showed that my PID had been concatenated with a UUID and that a
> FactoryPid property had been created with PID value =
> test.blueprint.bean.configurable-bean.
> 
> I changed the PID to test.blueprint.bean.configurablebean (removed the
> hyphen) and everything seems to be working.
> 
> STRANGE!!
> 
> - Jorge
> 
> 
> 
> 
> --
> View this message in context: http://apache-felix.18485.x6.nabble.com/Blueprint-and-ConfigAdmin-tp5005672p5005772.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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: Blueprint and ConfigAdmin

Posted by bokie <jm...@gmail.com>.
If anyone runs into a similar problem here goes...

In my case the problem was due to the PID that I used
(test.blueprint.bean.configurable-bean). The hyphen seems to cause some
strange behaviour in karaf. I noticed, in karaf, that the command
config:list showed that my PID had been concatenated with a UUID and that a
FactoryPid property had been created with PID value =
test.blueprint.bean.configurable-bean.

I changed the PID to test.blueprint.bean.configurablebean (removed the
hyphen) and everything seems to be working.

STRANGE!!

- Jorge




--
View this message in context: http://apache-felix.18485.x6.nabble.com/Blueprint-and-ConfigAdmin-tp5005672p5005772.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.

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


Re: Blueprint and ConfigAdmin

Posted by David Jencks <da...@yahoo.com>.
You are more likely to get a useful answer by asking on a list for aries which develops the apache blueprint implementation.

david jencks

On Oct 20, 2013, at 12:21 PM, bokie <jm...@gmail.com> wrote:

> Hi,
> 
> I'm trying to get configuration to work with blueprint and I'm using Apache
> Karaf 2.2.3 as the test platform. However, I'm not getting any call into my
> update method of my "configurable" bean. My blueprint descriptor looks like
> this:
> ===================================
> <bean
>  id="configurableBean"
>  scope="singleton"
>  activation="eager"
>  class="test.blueprint.bean.ConfigurableBean"
>  init-method="init"
>  destroy-method="destroy">
>  <cm:managed-properties
>    persistent-id="test.blueprint.bean.configurable-bean"
>    update-method="update"
>    update-strategy="component-managed"/>
> </bean>
> ===================================
> 
> and my ConfigurableBean class looks like this:
> ===================================
> public final class ConfigurableBean {
>  public void init() {}
>  public void update(Map<String, String> properties) {}
>  public void destroy() {}
> }
> 
> I've also dropped a file name test.blueprint.bean.configurable-bean.cfg in
> the ~/apache-karaf/2.3.3/etc directory.
> 
> Is my understanding of how this should work correct or am I missing
> something?
> 
> Thanks,
> Jorge
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://apache-felix.18485.x6.nabble.com/Blueprint-and-ConfigAdmin-tp5005672.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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