Skip to main content



      Home
Home » Eclipse Projects » Gemini » Gemini Blueprint 1.0.0.M1 Managed service factory
Gemini Blueprint 1.0.0.M1 Managed service factory [message #651648] Mon, 31 January 2011 22:41 Go to next message
Eclipse UserFriend
I've been experimenting with Blueprint 1.0.0.M1 on Equinox 3.6.1 with some fairly positive results. I've run into an issue though with getting the managed service factory update-method callback to execute when Equinox starts.

With a managed service factory defined with several configuration keys/values in Equinox, the only time I can get the update-method callback to fire on my bean is when I add or modify a configuration key/value pair after Equinox is started. I would expect the update-method callback to fire when Equinox starts, just like it does for managed-properties on a managed service.

I'd be happy to supply example code but I wanted to see if anyone was aware of any known issues before I threw something together.

Thanks!


Re: Gemini Blueprint 1.0.0.M1 Managed service factory [message #652809 is a reply to message #651648] Sun, 06 February 2011 23:12 Go to previous messageGo to next message
Eclipse UserFriend
Here's a bit of sample code illustrating my problem outlined in the post above. Does anybody see anything incorrect with the way I'm going about creating the managed service factory? Any help is greatly appreciated!

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
	xmlns:cm="http://www.springframework.org/schema/osgi-compendium"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"
	xsi:schemaLocation="
		http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
		http://www.springframework.org/schema/osgi-compendium http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

	<cm:managed-service-factory id="testfactory"
		factory-pid="testfactory"
		auto-export="all-classes"
		update-method="update">

		<bean class="testplugin.ServerImpl" />
	</cm:managed-service-factory>
</blueprint>

package testplugin;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class ServerImpl {

	Logger log = LoggerFactory.getLogger(ServerImpl.class);
	
	public ServerImpl() {
		log.info("Server Created!");
	}

	public void update (Map<String,?> props) {
		log.info("Configuration updated - {}.",props.toString());
	}	
}

osgi> cm getv testfactory-1297050867612-0

Configuration for service (pid) "testfactory-1297050867612-0"
(bundle location = reference:file:/Users/grapp/Documents/workspace-sts/TestPlugin/)

key                  value                             type
------               ------                            ------
key1                 value1                            java.lang.String
service.factoryPid   testfactory                       java.lang.String
service.pid          testfactory-1297050867612-0       java.lang.String

Re: Gemini Blueprint 1.0.0.M1 Managed service factory [message #652962 is a reply to message #651648] Mon, 07 February 2011 13:45 Go to previous messageGo to next message
Eclipse UserFriend
Sounds like an inconsistency though I have to review the code first - a fix and a bugzilla issue would be most welcome.
Re: Gemini Blueprint 1.0.0.M1 Managed service factory [message #652963 is a reply to message #652962] Mon, 07 February 2011 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the response! I'd be happy to submit a Bugzilla issue.

I poked around in the code for a couple of hours and couldn't find the culprit. I do have to admit that it was a bit over my head though since I couldn't quite figure out the code paths and what was being executed when.
Re: Gemini Blueprint 1.0.0.M1 Managed service factory [message #653084 is a reply to message #651648] Tue, 08 February 2011 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Filed as bug 336578
Re: Gemini Blueprint 1.0.0.M1 Managed service factory [message #655050 is a reply to message #653084] Fri, 18 February 2011 02:28 Go to previous message
Eclipse UserFriend
Thanks!
Previous Topic:loading JPA embeddable classes stored in other bundles
Next Topic:Deadlock with Lazy Activation on Felix
Goto Forum:
  


Current Time: Mon Jul 07 04:00:42 EDT 2025

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

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

Back to the top