Hi,

On 06.08.2010 14:13, Vidar Ramdal wrote:
> On Fri, Aug 6, 2010 at 2:04 PM, Bertrand Delacretaz
> <[email protected]> wrote:
>> On Fri, Aug 6, 2010 at 1:40 PM, Vidar Ramdal <[email protected]> wrote:
>>> ...In principle, all you need to do is have a string constant annotated
>>> as @scr.property (or @Property if you're using the 'real'
>>> annotations). Then create local variables to store the property
>>> values. These values are fetchted from the Felix ConfigAdmin on
>>> component activation....
>>
>> I just did that this morning for the bgservlets module, if you look at
>> [1] you'll get an example of how to make things configurable, using
>> the "modern" annotations.
> 
> Yeah, use the modern annotations and not the old javadoc ones (that
> is, use @Property, not /** @scr.property */). The modern ones are
> easier to maintain, as you can use Java constants as values.
> Refactoring support in IDEs are also much better.
> 
> And, I forgot to mention, if you want a proper-looking configuration
> form in the Felix web console, you should supply a
> resources/OSGI-INF/metatype/metatypes.properties file, and specify
> metatype=true on your Component annotation. This also demonstrated in

Actually metatype is generated by default, so no need for
"metatype=true". You need the metatype attribute only if you want to
prevent this information from being generated.

Regards
Felix

Reply via email to