Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Configurations and service.factoryPid(How to associate multiple Configurations to one ManagedServiceFactory PID?)
Configurations and service.factoryPid [message #1000873] Tue, 15 January 2013 10:21 Go to next message
Daniela Weil is currently offline Daniela Weil
Messages: 3
Registered: January 2013
Junior Member
Hi,

in Virgo Kernel 3.6.0 I deployed two property files in the pickup directory. Both contain the property
service.factoryPid=de.zivit.ccn.csi.api.factoryConnectionSpec


In the osgi console they show up as
vsh:config list                                                              

Name                                                       Version         State
de.zivit.ccn.csi.api.factoryConnectionSpec-1358260960174-3 0.0.0          ACTIVE
de.zivit.ccn.csi.api.factoryConnectionSpec-1358260969136-4 0.0.0          ACTIVE 

vsh:config examine de.zivit.ccn.csi.api.factoryConnectionSpec-1358260969136-4

Factory pid:     
Bundle Location: 

Properties:
    appName:
        variante1App
    appPassword:
        variante1AppPasswd
    service.pid:
        de.zivit.ccn.csi.api.factoryConnectionSpec-1358260969136-4
.....

I'd have expected to see the service factory pid in the listing.

In my bundle I registered a ManagedServiceFactory service with "service.pid=de.zivit.ccn.csi.api.factoryConnectionSpec" whose "updated(String, Dictionary)" method is never called.

How can I check whether the configuration admin manages two Configurations with the factoryPid "de.zivit.ccn.csi.api.factoryConnectionSpec"?

Kind Regards,
daniela

[Updated on: Wed, 16 January 2013 02:51]

Report message to a moderator

Re: Configurations and service.factoryPid [message #1004646 is a reply to message #1000873] Wed, 23 January 2013 10:31 Go to previous messageGo to next message
Castor Rodriguez is currently offline Castor Rodriguez
Messages: 4
Registered: August 2011
Junior Member
I'm sorry, I've posted the same over here: (http://www.eclipse.org/forums/index.php/m/1004642/).

In the post I explain how I tried to figure it out what is going on, but I don't get any conclusion.

Once again I'm sorry for the duplication, I would be glad if anyone could turn the other post into a comment of this one.

Regards.

[Updated on: Wed, 23 January 2013 10:32]

Report message to a moderator

Re: Configurations and service.factoryPid [message #1006733 is a reply to message #1004646] Fri, 01 February 2013 11:15 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
ManagedServiceFactory must be registered with service.factoryPid not service.pid.

You can see examples in http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/compendium.html#compendium:cm section 11.1.3

<osgix:managed-service-factory factory-pid="de.zivit.ccn.csi.api.factoryConnectionSpec"
                                   interface="de.zivit.ccn.csi.api.ConnectionSpec"
                                   update-strategy="container-managed">
        <bean class="de.zivit.ccn.csi.api.MutableConnectionSpec"/>
    </osgix:managed-service-factory>

// manual registration of ManagedServiceFactory
// connectionspecfactory must implement ManagedServiceFactory interface
<bean id="connectionSpecFactory" class="de.zivit.ccn.csi.api.ConnectionSpecFactory" />
<osgi:service interface="org.osgi.service.cm.ManagedServiceFactory" ref="connectionSpecFactory">
        <osgi:service-properties>
            <entry key="service.pid" value="de.zivit.ccn.csi.api.factoryConnectionSpec"/>
        </osgi:service-properties>
    </osgi:service>



If you can please provide a code snippet with your configuration and I will be able to help further.

Thanks
Dmitry
Re: Configurations and service.factoryPid [message #1007120 is a reply to message #1006733] Mon, 04 February 2013 09:26 Go to previous messageGo to next message
Daniela Weil is currently offline Daniela Weil
Messages: 3
Registered: January 2013
Junior Member
Dear Dmitry,

I tried two approaches:
1. Using a gemini blueprint configuration as follows (as I couldn't post http urls, I changed the protocol part to h/ in the urls)
<blueprint xmlns="h/www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="h/www.w3.org/2001/XMLSchema-instance"
           xmlns:context="h/www.springframework.org/schema/context"
           xmlns:beans="h/www.springframework.org/schema/beans"
           xmlns:compendium="h/www.eclipse.org/gemini/blueprint/schema/blueprint-compendium"
           xsi:schemaLocation="h/www.springframework.org/schema/context
			h/www.springframework.org/schema/context/spring-context.xsd
			h/www.eclipse.org/gemini/blueprint/schema/blueprint-compendium
			h/www.eclipse.org/gemini/blueprint/schema/blueprint-compendium/gemini-blueprint-compendium.xsd
			h/www.osgi.org/xmlns/blueprint/v1.0.0
			h/www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
			h/www.springframework.org/schema/beans 
			h/www.springframework.org/schema/beans/spring-beans.xsd"
			 default-activation="eager">	
 <service interface="org.osgi.service.cm.ManagedServiceFactory" ref="myManagedServiceFac">
   		<service-properties>
     		<entry key="service.pid" value="de.zivit.ccn.csi.api.factoryConnectionSpec"/>
   		</service-properties>
 </service>

 <bean id="myManagedServiceFac" class="de.zivit.ccn.dani.internal.ManagedServiceFrontImplFactory">
	<argument ref="bundleContext"/>
	<property name="log" ref="osgi.LogService"/>
 </bean>
 <reference id="osgi.LogService" interface="org.osgi.service.log.LogService"/>
</blueprint>


2. A BundleActivator (no blueprint xml in the bundle)
@Override
	public void start(BundleContext context) throws Exception {
		ManagedServiceFrontImplFactory msf = new ManagedServiceFrontImplFactory(context);
		loggerReference = context.getServiceReference(LogService.class);
		LogService logger = (LogService) context.getService(loggerReference);
		msf.setLog(logger);
		Dictionary<String, Object> props = new Hashtable<String,Object>();
		props.put(Constants.SERVICE_PID,"de.zivit.ccn.csi.api.factoryConnectionSpec" );
		reg= (ServiceRegistration) context.registerService(ManagedServiceFactory.class.getName(),msf,props);
}


In both cases the ManagedServiceFactory did not receive any configuration data.

Kind Regards,
daniela
Re: Configurations and service.factoryPid [message #1007129 is a reply to message #1007120] Mon, 04 February 2013 09:58 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
I will run the test locally. Might be a regression. Stay tuned Smile

Thanks!
Re: Configurations and service.factoryPid [message #1007174 is a reply to message #1007129] Mon, 04 February 2013 13:16 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
Found the issue. Will be fixed shortly.

Thanks!

Dmitry
Re: Configurations and service.factoryPid [message #1007232 is a reply to message #1007174] Tue, 05 February 2013 02:43 Go to previous messageGo to next message
Daniela Weil is currently offline Daniela Weil
Messages: 3
Registered: January 2013
Junior Member
Hi Dmitry,

thanks for your feedback.

Is there any bug I can track to get to know when the issue is fixed?

Kind regards,
daniela
Re: Configurations and service.factoryPid [message #1007300 is a reply to message #1007232] Tue, 05 February 2013 07:47 Go to previous message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 271
Registered: January 2010
Senior Member
There is https://bugs.eclipse.org/bugs/show_bug.cgi?id=325735.

Regards,
Dmitry
Previous Topic:Initial artifact vs plan deployed in pickup
Next Topic:How do you set up Spring AOP/AspectJ/Virgo
Goto Forum:
  


Current Time: Wed Jul 23 04:05:08 EDT 2014

Powered by FUDForum. Page generated in 0.02130 seconds