Thanks, I got it working. For anyone else that¹s interested, just use the
following annotation on your component:

@Component(
    configurationPolicy = ConfigurationPolicy.require,
    designateFactory = Config.class
)

public class SomeClass {

    start(), stop(), etc...
}

Where your config class is:

public interface Config {
    String propertyKey();
}


Now you will create an instance for each etc/SomeClass-*.cfg

Pretty simple.

Thank you!








On 5/7/15, 4:35 PM, "Jamie G." <[email protected]> wrote:

>Try the Managed Service Factory demo from the Karaf Cookbook:
>https://github.com/jgoodyear/ApacheKarafCookbook/tree/master/chapter2/chap
>ter2-recipe6/msf
>
>It'll at least get you started :)
>
>Cheers,
>Jamie
>
>On Thu, May 7, 2015 at 6:03 PM, Stephen Kahmann
><[email protected]> wrote:
>> Hi all,
>>
>> Can anyone point me to an example of setting up a factory configuration
>>in
>> Karaf? I have a component that I want to instantiate multiple times with
>> various configurations. I read on another post to this list that Factory
>> Configurations with BND MetaType was a good way to go. Then I can just
>> create <factory-pid>-whatever.cfg files to instantiate the components;
>> however, I can¹t figure out how to configure the bnd annotations to get
>>this
>> working. Can anyone provide some assistance?
>>
>> Thank you!
>>

Reply via email to