You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by gnanda1 <gi...@hotmail.com> on 2010/07/01 06:02:59 UTC

Re: reading config properties to a hashtable

Hi Freeman,

what dependency I have to add in my pom to get access to
ConfigCommandSupport?

Would you suggest using any other class to get a reference to the
ConfigurationAdmin ? In my scenario could I just use ConfigCommandSupport
class in both the side (building Dictionary and consumer class accessing the
dictionary to retrieve data). 

Thanks & Regards
Gnanda
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p512269.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: reading config properties to a hashtable

Posted by gnanda1 <gi...@hotmail.com>.
Please check the below link

http://servicemix.396122.n5.nabble.com/How-do-I-read-the-property-values-from-ConfigurationAdmin-for-a-PID-from-camel-code-td512223.html#a512613

In my xbean.xml file, I  have following lines

<osgi:reference id="configAdmin"
		interface="org.osgi.service.cm.ConfigurationAdmin" />

<bean id="processor" class="com.pf.management.mbean.CommandProcessor">
		
		<property name="configAdmin" ref="configAdmin" />
			</bean>

And in CommandProcessor java class , I have a setmethod corresponding to
"configAdmin" property
public void setConfigAdmin(ConfigurationAdmin configAdmin) {
		this.configAdmin = configAdmin;
	}
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p2740243.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: reading config properties to a hashtable

Posted by buzzvamsi <va...@gmail.com>.
Could you give me that Gert suggestion link please. I am unable to configure
this. I get BundleContext property required exception.

Any help please
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p2740152.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: reading config properties to a hashtable

Posted by gnanda1 <gi...@hotmail.com>.
Thanks Freeman. I did as Gert suggested in another thread and it worked.


-- 
View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p1045212.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: reading config properties to a hashtable

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

As Gert point out in another thread,

The easiest way to do that would be by creating the bean in the
Spring file where you defined your <camelContext>, leveraging Spring  
DM to
access either the ConfigurationAdmin (and inject that into your bean
afterwards) ...

<reference id="configAdmin"
interface="org.osgi.service.cm.ConfigurationAdmin"/>


Freeman
On 2010-7-7, at 上午4:31, gnanda1 wrote:

>
> Hi Freeman,
> I am still trying to figure out how to get a reference to  
> bundlecontext or
> configurationAdmin from my SU component to read/update properties  
> file.
>
> Is there any interface that I could implement to get a refrence to the
> bundlecontext  or somehow I could inject bundleconext or  
> configuartionAdmin
> thru camel-context.xml file?
>
> currently I do not have any osgi bundle , I do have only SAs  
> deployed in
> smx.
> Please suggest
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p946343.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: reading config properties to a hashtable

Posted by gnanda1 <gi...@hotmail.com>.
Hi Freeman,
I am still trying to figure out how to get a reference to bundlecontext or
configurationAdmin from my SU component to read/update properties file.

Is there any interface that I could implement to get a refrence to the
bundlecontext  or somehow I could inject bundleconext or configuartionAdmin
thru camel-context.xml file?

currently I do not have any osgi bundle , I do have only SAs deployed in
smx.
Please suggest
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p946343.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: reading config properties to a hashtable

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

I guess you miss my previous answer, you needn't and shouldn't use  
ConfigCommandSupport.
I just show you that class to demonstrate how to use  
ConfigurationAdmin service.

Freeman
On 2010-7-1, at 下午12:02, gnanda1 wrote:

>
> Hi Freeman,
>
> what dependency I have to add in my pom to get access to
> ConfigCommandSupport?
>
> Would you suggest using any other class to get a reference to the
> ConfigurationAdmin ? In my scenario could I just use  
> ConfigCommandSupport
> class in both the side (building Dictionary and consumer class  
> accessing the
> dictionary to retrieve data).
>
> Thanks & Regards
> Gnanda
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-tp511758p512269.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang
------------------------
Open Source SOA: http://fusesource.com