Level 1
Level 2
Sign in to Community
Learn more
Sign in to view all badges
Expand my Community achievements bar.
This conversation has been locked due to inactivity. Please create a new post.
Hi everyone,
Can I add a custom property on my OSGI service?
ex.
@Properties({ @Property(name ="NewValue", intValue = 0, propertyPrivate = false, label="custom value")})@Servicepublic class NameClass
If I can, How I access to the property in my source code?
Thanks,
Solved! Go to Solution.
Yes, You can add and access the same using
ComponentContext.getProperties.get(<property name>)
View solution in original post
Yes, also
Use this code in the activate method.
Dictionary<?, ?> properties = componentContext.getProperties();
Object propertyObject = properties.get(PROPERTY_NAME);
Views
Likes
Replies