Blueprint and service factory configuration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Blueprint and service factory configuration

I am having great dificulty getting ConfigurationAdmin factory properties to work with blueprint. I use webconsole to create configurations for service factory.

Here is my blueprint:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns=""
        <cm:managed-service-factory factory-pid="flow"
                        class=" org.test.mockoperation1.flow.FlowPeerImpl">

My metatype.xml:
<?xml version="1.0" encoding="UTF-8"?>
<MetaData xmlns="">
  <OCD name=" Mock Operation 1 :: Flow 1.0.0" id="org.testmockoperation1.flow.1.0.0">
    <AD name="Channel name" id="configChannelName" type="String" description="Unique channel name"/>
  <Designate pid="org.testmockoperation1.flow.1.0.0" factoryPid="org.testmockoperation1.flow.1.0.0">

FlowPeerImpl bean contains configChannelName property.

1) Even if I do not have any factory configuration, I get one instance of FlowPeerImpl
2) When I add factory configuration, I get two instances.
3) In webadmin I see that configuration is consumed, but configChannelName is not set from blueprint container
4) Looking at schema I can’t for the life of me figure out:
        a. Where do I specify container-managed or component-managed properties type
        b. Where do I specify update method for component-managed type
5) If I look at Spring schema, things are quite different. Following is valid in Spring-DM but not Aries (update-strategy and update-method are not allowed):
        <osgix:managed-service-factory id="data-msf"

I have to say configuration is poorly handled in blueprint. Another example:
component-managed behaves as container-managed on initial construction (meaning bean properties have to be defined) while update method is called on subsequent config changes.

This means that I have to implement properties while also handle them in updated method as a Dictionary.

This behavious is due to following line of code in bean, boolean initial):
if(initial || "container-managed".equals(updateStrategy))

Maybe it's me but I really don’t understand any of this.

Any help appreciated.