I use Apache Aries 0.2 in Servicemix 4.3.1 and create cm: managed-service-factory. Creating services with .cfg files works fine (except # ARIES-584 ), but the properties from the .cfg file are not entered into the service object. They are set correctly in ConfigAdmin, only my bean configuration methods are never called for values ββin my configuration file.
I thought I should use the cm: managed-properties or something similar in my managed factory service, but that would require a separate pid, so it doesn't seem right.
If I do not put a property tag, then the value will never be set. With a property tag, then only the default value will be set, but the actual value of the configuration file will never be.
I can not find any documentation for using the Aries CM subproject, except blueprint-sample.xml , which does not show managed properties inside the factory managed service. I am really trying to use Servicemix, but around every corner there is no documentation, broken or missing functions or errors that affect the main functions.
Both spring and gemini documentation indicates that their factory-managed service implementations should also function as managed properties.
foo.xml:
<blueprint> <cm:managed-service-factory id="myfoo-msf" factory-pid="my.msf" interface="my.IFoo"> <cm:managed-component class="my.Foo"> <property name="name" value="default /> </cm:managed-component> </cm:managed-service-factory> </blueprint>
Ifoo.java
package my; public interface IFoo { public String getName(); public void setName(String name); }
Foo.java
package my; public class Foo implements IFoo { private String name; public void setName(String name) { this.name = name; System.out.println("name set to: " + name); } public String getName() { return name; } }
my.msf-1.cfg
name=name1
my.msf-2.cfg
name=name2
System.out
name set to default name set to default
configurations: proplist
service.pid = my.msf.xxxxxxx-xx-xx-xxxxxxxxxxxxxxx name = name1 service.factoryPid = my.msf service.pid = my.msf.yyyyyyy-yy-yy-yyyyyyyyyyyyyyy name = name2 service.factoryPid = my.msf