felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven E. Harris" <...@panix.com>
Subject Using iPOJO's ManagedServiceFactory support
Date Fri, 02 Mar 2007 20:04:50 GMT
I have a class in a bundle of which I'd like instances to be created
per the ManagedServiceFactory model; whenever a Configuration gets
established for a particular factory PID, an instance of this class
should get created and, somehow, this new instance should have some
access to the properties in the Configuration that forced it to be
created.

This bundle's iPOJO metadata is as follows:

,----
| <?xml version="1.0" encoding="UTF-8"?>
| <iPOJO>
|    <component className="mycorp.Foo"
|               factory="mycorp.foo_factory"/>
| </iPOJO>
`----

I can see that this bundle has both an org.apache.felix.ipojo.Factory
and an org.osgi.service.cm.ManagedServiceFactory registered on its
behalf, including the property

  service.pid=mycorp.foo_factory

In another bundle, I use the ConfigurationAdmin service to create a
new factory configuration using "mycorp.foo_factory" as the
PID. However, I never see my mycorp.Foo class constructor get
called.

For the record, it doesn't look like
org.apache.felix.ipojo.ComponentFactory.updated() ever gets called
either, which I assume is iPOJO's ManagedServiceFactory
implementation.

Should iPOJO create an instance of mycorp.Foo when a Configuration
with a matching factoryPid is available? Am I missing some
declarations in the metadata file to enable this behavior?

-- 
Steven E. Harris

Mime
View raw message