You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by AlanFoster <al...@alanfoster.me> on 2012/09/01 10:42:30 UTC

Accessing osgi blueprint property-placeholder across multiple bundles

Hi

I have a question concerning this example :
http://camel.apache.org/properties.html#Properties-UsingBlueprintpropertyplaceholderwithCamelroutes

I wonder if these inlined proerties can be accessed across many bundles? IE
bundle A defines a property-placeholder and bundle B is able to access those
defined inlined properties

I haven't been able to get this to work properly, and I wonder if it is
indeed possible?

If anyone has any knowledge of this I'd greatly appreciate it!

Thanks
Alan



--
View this message in context: http://camel.465427.n5.nabble.com/Accessing-osgi-blueprint-property-placeholder-across-multiple-bundles-tp5718494.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Accessing osgi blueprint property-placeholder across multiple bundles

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

Yes, using system property is one solution,  to use system property in blueprint file, you need use blueprint-ext but not blueprint-cm(blueprint-cm is for ConfigAdmin properties)

something like:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0">

<ext:property-placeholder />

<bean id="myBean" class="com.company.MyClass">
<argument value="${com.company.myProperty} />
</bean>

</blueprint>

And you can use both blueprint-ext and blueprint-cm together.

Freeman

-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-9-4, at 上午2:55, Christian Müller wrote:

> If you use ServiceMix or Karaf, you can put your custom properties into
> "etc/custom.properties" and use these placeholders in your bundle
> properties file.
> Than you have a central place for common/shared configuration data.
> 
> Best,
> Christian
> 
> On Mon, Sep 3, 2012 at 2:05 PM, AlanFoster <al...@alanfoster.me> wrote:
> 
>> @Freeman-2
>> 
>> Hm, this isn't good to hear :(
>> 
>> Do you happen to know of any alternatives for this? I wish to share common
>> configuration across bundles with blueprint somehow
>> 
>> Alan
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Accessing-osgi-blueprint-property-placeholder-across-multiple-bundles-tp5718494p5718544.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>> 
> 
> 
> 
> --


Re: Accessing osgi blueprint property-placeholder across multiple bundles

Posted by Christian Müller <ch...@gmail.com>.
If you use ServiceMix or Karaf, you can put your custom properties into
"etc/custom.properties" and use these placeholders in your bundle
properties file.
Than you have a central place for common/shared configuration data.

Best,
Christian

On Mon, Sep 3, 2012 at 2:05 PM, AlanFoster <al...@alanfoster.me> wrote:

> @Freeman-2
>
> Hm, this isn't good to hear :(
>
> Do you happen to know of any alternatives for this? I wish to share common
> configuration across bundles with blueprint somehow
>
> Alan
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Accessing-osgi-blueprint-property-placeholder-across-multiple-bundles-tp5718494p5718544.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: Accessing osgi blueprint property-placeholder across multiple bundles

Posted by AlanFoster <al...@alanfoster.me>.
@Freeman-2

Hm, this isn't good to hear :(

Do you happen to know of any alternatives for this? I wish to share common
configuration across bundles with blueprint somehow 

Alan



--
View this message in context: http://camel.465427.n5.nabble.com/Accessing-osgi-blueprint-property-placeholder-across-multiple-bundles-tp5718494p5718544.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Accessing osgi blueprint property-placeholder across multiple bundles

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

No, I don't think so.

Per the Configuration Admin spec

Do not share the same persistent-id (PID) between multiple bundles or definitions, as only one of them will receive notifications. managed-properties relies on org.osgi.service.cm.ManagedService contract which mandates that each ManagedService instance must be identified with its own unique PID. Please see the Configuration Admin spec, specifically section 104.3 and 104.5

Freeman
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-9-1, at 下午4:42, AlanFoster wrote:

> Hi
> 
> I have a question concerning this example :
> http://camel.apache.org/properties.html#Properties-UsingBlueprintpropertyplaceholderwithCamelroutes
> 
> I wonder if these inlined proerties can be accessed across many bundles? IE
> bundle A defines a property-placeholder and bundle B is able to access those
> defined inlined properties
> 
> I haven't been able to get this to work properly, and I wonder if it is
> indeed possible?
> 
> If anyone has any knowledge of this I'd greatly appreciate it!
> 
> Thanks
> Alan
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Accessing-osgi-blueprint-property-placeholder-across-multiple-bundles-tp5718494.html
> Sent from the Camel - Users mailing list archive at Nabble.com.