Checkboxes Osgi property via run modes/ Setup checkboxes for osgi

If you want to create checkboxes for your OSGI properties then you can do it by having boolValue attribute assigned to Property annotation.

@Property(boolValue = false/true)
public static final String XYZ_PROPERTY = “”;

private boolean xyz;

Retrieving these properties is also simple, you can simply do it like this

public void activate(final Map<String, String> properties) { = PropertiesUtil.toBoolean(properties.get(XYZ_PROPERTY ), false);


But sometimes you will run into situations where you would need to override these values from OSGI config. If you remove the boolValue from property annotation then the property will be treated as String instead of Boolean.

Example: you want checkbox checked for this above property from OSGI and you somehow don’t want to do it via code because this might change for environments

In your run mode file, if you have the below property and boolValue within the property annotation in the code, you are sorted.”{Boolean}true”



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s