felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olaf Otto <o...@x100.de>
Subject ManagedServiceFactory and SCR metadata
Date Tue, 25 Oct 2011 11:13:14 GMT
Hi,

I am trying to create a ManagedServiceFactory implementation and have so 
far failed to get it to work using SCR metadata. The plugin 
documentation is somewhat confusing; is it impossible to use a dynamic 
service declaration for a ManagedServiceFactory? 
(http://felix.apache.org/site/apache-felix-maven-scr-plugin.html)

What I have is this

@Service(ManagedServiceFactory.class)
@Component(label = "Test service factory", metatype = true)
@Properties({
     @Property(name = "service.pid", value = 
"org.acme.FactoredType.factory")
})
public class TestServiceFactory implements ManagedServiceFactory {
  @Property(value = "defaultValue")
  public static final String SOME_PROPERTY = "someProperty";
  // implementation...
}

However The service shows up like a regular Service in the felix config 
admin. I can edit the @Property, and the config is persisted in the 
admin service, however none of the implemented ManagedServiceFactory 
methods get called. Do I need to use the factory... properties of the 
@Component annotation? Is it necessary to manually register the service?

Any hint is appreciated!
Thanks,
Olaf

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message