Hi Folks,
I have imported one configuration using @Designate in my Component class. Now I need to add another one but @Designate doesn't allow. Is there any other way I can access another configuration in the same class? Thanks in advance!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @prachiz ,
Based on above assertions, to answer your question, unfortunately there in no way of referring multiple OCD's configuration. However, you can achieve that by defining those MetaType (@AttributeDefinition) in your original existing @interface which you are using in your component class.
OR
It might be much better to move the common configuration into some kind of configuration service, and centralize all common functionality there and use in other services using @Reference annotation.
[0]: http://docs.osgi.org/javadoc/r6/cmpn/org/osgi/service/metatype/annotations/Designate.html
[1]: https://docs.oracle.com/javase/specs/jls/se7/html/jls-9.html#jls-9.6
Hope that helps!
Regards,
Santosh
Hi @prachiz ,
Based on above assertions, to answer your question, unfortunately there in no way of referring multiple OCD's configuration. However, you can achieve that by defining those MetaType (@AttributeDefinition) in your original existing @interface which you are using in your component class.
OR
It might be much better to move the common configuration into some kind of configuration service, and centralize all common functionality there and use in other services using @Reference annotation.
[0]: http://docs.osgi.org/javadoc/r6/cmpn/org/osgi/service/metatype/annotations/Designate.html
[1]: https://docs.oracle.com/javase/specs/jls/se7/html/jls-9.html#jls-9.6
Hope that helps!
Regards,
Santosh
Thanks @SantoshSai . That was helpful!
Views
Likes
Replies
Views
Likes
Replies