Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[osgi-users] Non-String Framework Properties

Hi,
I am wondering how the different types of framework property values are coerced to String.
According to https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/dto/FrameworkDTO.html#properties:  

"The value type must be a numerical type, Boolean, String, DTO or an array of any of the former."

Evaluation via BundleContext.getProperty(...) always returns a string (https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/BundleContext.html#getProperty-java.lang.String-)
Neither https://docs.osgi.org/javadoc/osgi.core/8.0.0/org/osgi/framework/launch/FrameworkFactory.html#newFramework-java.util.Map- nor https://docs.osgi.org/specification/osgi.core/8.0.0/framework.lifecycle.html#framework.lifecycle.launchingproperties explain the different supported types of framework properties nor how they are converted to String.

So my questions are:

1. How are other types coerced to String in BundleContext.getProperty(...)?
2. What happens if non-supported types are given to FrameworkFactory.newFramework()?
3. How to evaluate properties in their native type except via FrameworkDTO.properties?
4. Is Apache Felix behaving spec-conform when leaving out all non-String properties from BundleContext.getProperty(...): https://github.com/apache/felix-dev/blob/3abe9f13b04ff56a5a6d62cf3522c04b0c0e16ff/framework/src/main/java/org/apache/felix/framework/Felix.java#L3120

Thanks in advance,
Konrad

Back to the top