Hi Pradeep,
In IHMO, your possible solution contains a security flaw, the client
can Inject everything.
I think that in declarative mode is not possible to do you solution,
but in programmatic in your bundle you can do
some like this.
ServiceReference ref =
bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
if (ref != null) {
ConfigurationAdmin cm = (ConfigurationAdmin)
bundleContext.getService(ref);
if (cm != null) {
try {
Dictionary dict =
cm.getConfiguration(persistentId).getProperties();
ecc.ecc
}
Regards
--Filippo
2012/8/29 pradet <[email protected]>:
> Hi,
>
> Currently i am reading the property file using OSGi config Admin services
> approach. which is working fine.
>
> <cm:property-placeholder persistent-id="sampleFile"
> update-strategy="reload">
> <cm:default-properties>
> <cm:property name="host" value=""/>
> <cm:property name="host1" value=""/>
> </cm:default-properties>
> </cm:property-placeholder>
>
> Where, 'sampleFile.cfg' is my config file, which I have placed in the ETC
> folder of ServiceMix.
>
> I want to read the key name also from property file. i.e. instead of
> hardcoding the keyname in the blueprint XML file. I want to pass the
> property Key name which I am getting from an HTTP parameter.
>
> Can I configure something like this ?
>
> <cm:default-properties>
> <cm:property name="${in.header.<paramname>}"
> value=""/>
> </cm:default-properties>
>
> Can someone let me know, if this can be done ?
>
> Thanks in Advance,
>
> Pradeep
>
>
>
>
> --
> View this message in context:
> http://servicemix.396122.n5.nabble.com/Is-it-possible-to-read-property-key-without-hardcoding-in-Blueprint-using-OSGi-config-Admin-tp5714288.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.