Hi Alexander,
Alexander Shutyaev schrieb:
> Thanks for your help! I checked on your example. It looks like this is
> the thing.
Glad to hear ;-)
> But I'm a little bit of newbie in OSGi, so I'm not confident
> in two things:
> 1) How should I declare that component in a xml-file in that case.
> 2) How should I construct new Configuration objects in that case.
> If you could you give me the svn-links that clarify these two questions
> for Apache's 'RequestLoggerService' it would be very great.
In Apache Felix we have a Maven 2 plugin, which constructs the
Declarative Services declaration from the @scr.* tags in the Java source
file. You might want to check that out. Otherwise you might want to
check out the Sling Engine bundle from [1], which encloses an
OSGI-INF/serviceComponents.xml file, which contains the declaration for
the RequestLoggerService.
As for the generation of configuration objects: You can manually create
those, by getting the Configuration Admin Service and call
createFactoryConfiguration on it:
ConfigurationAdmin ca = getConfigurationAdmin();
Configuration config =
ca.createFactoryConfiguration("the.factory.pid");
Properties props = new Properties();
// prepare configuration properties
config.update(props);
Hope this helps.
Regards
Felix
[1]
http://people.apache.org/repo/m2-incubating-repository/org/apache/sling/org.apache.sling.engine/2.0.2-incubator/org.apache.sling.engine-2.0.2-incubator.jar
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev