Skip to main content

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

Thanks Carsten,
I have not seen hat FrameworkFactory only takes String values.

Konrad

> On 19. Oct 2021, at 07:09, Carsten Ziegeler <cziegeler@xxxxxxxxxx> wrote:
> 
> Hi,
> 
> I'm not sure if there is in reality a situation where a framework property can actually have a different type than String
> 
> When you launch a framework (via FrameworkFactory), the map of launcher properties is typed as <String, String>, so you can't provide any different type.
> 
> I assume the FrameworkDTO is more relaxed for the property type to allow for future additions.
> 
> Regards
> Carsten
> 
> Am 18.10.2021 um 15:37 schrieb Konrad Windszus:
>> 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
>> _______________________________________________
>> osgi-users mailing list
>> osgi-users@xxxxxxxxxxx
>> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
>> https://dev.eclipse.org/mailman/listinfo/osgi-users
> 
> -- 
> Carsten Ziegeler
> Adobe
> cziegeler@xxxxxxxxxx
> _______________________________________________
> osgi-users mailing list
> osgi-users@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/osgi-users



Back to the top