Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Configuration bundles for managed service factory
Configuration bundles for managed service factory [message #953743] Mon, 22 October 2012 13:57 Go to next message
Marco Machmer is currently offline Marco Machmer
Messages: 3
Registered: June 2012
Junior Member
Hi,
i have some questions about managed service factories.
how do i configure a managed service factory in my spring configuration files?
is there an example?
and how is it possible to deploy a configuration bundle for a managed service factory?

i'm using virgo 3.5.0.

regards marco

[Updated on: Wed, 24 October 2012 10:19]

Report message to a moderator

Re: Configuration bundles for managed service factory [message #973121 is a reply to message #953743] Tue, 06 November 2012 04:55 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
Hello Marco,

Here is a link to documentation is http://static.springsource.org/osgi/docs/2.0.0.M1/reference/html/compendium.html#compendium:cm

In short you can:
1. use namespace support with <osgix:managed-service-factory/>
2. you can publish a custom implementation of ManagedServiceFactory interface

Deploying extra configurations is as simple as deploying a configuration artifact i.e. properties file with "service.factoryPid" property.
Actual service.pid will be auto generated by the ConfigurationAdmin in this case.

# factory pid for config admin service
service.factoryPid = test.factory.pid

# properties for the managed service
prop1 = prop1
prop2 = 2


Regards,
Dmitry
Re: Configuration bundles for managed service factory [message #1006622 is a reply to message #973121] Fri, 01 February 2013 09:04 Go to previous messageGo to next message
Marco Machmer is currently offline Marco Machmer
Messages: 3
Registered: June 2012
Junior Member
hi dmitry,

thanks for your help.
it doesn't work for me.
i have the same problems like daniela in her question:
http://www.eclipse.org/forums/index.php/t/448925/

i'm also using now virgo 3.6.
have you a complete example of a springcontext.xml for a ManagedServiceFactory service?

regards marco

[Updated on: Fri, 01 February 2013 09:19]

Report message to a moderator

Re: Configuration bundles for managed service factory [message #1006735 is a reply to message #1006622] Fri, 01 February 2013 16:16 Go to previous message
Dmitry Sklyut is currently offline Dmitry Sklyut
Messages: 272
Registered: January 2010
Senior Member
Marco,

I posted reply in the thread that you reference, but I will also reproduce it here.


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="connetionSpecFactory">
        <osgi:service-properties>
            <entry key="service.pid" value="de.zivit.ccn.csi.api.factoryConnectionSpec"/>
        </osgi:service-properties>
    </osgi:service>



Let me know if that helps, or please post an example of your config and I will be able to help further.

Thanks
Dmitry
Previous Topic:Virgo ability to work with unpacked bundles
Next Topic:Optional import of a hibernate's package unexpectedly became unresolved
Goto Forum:
  


Current Time: Wed Oct 01 00:04:50 GMT 2014

Powered by FUDForum. Page generated in 0.02542 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software