Declarative services: how to set a property? [message #69613] |
Tue, 11 July 2006 10:42  |
Eclipse User |
|
|
|
Hello,
in OSGI Service Compendium in Declarative Services section on page
282-432 I have found the following component.xml example:
<?xml version="1.0" encoding="UTF-8"?>
<component name="example.handler">
<implementation class="com.acme.HandlerImpl"/>
<property name="event.topics" value="some/topic"/>
<service>
<provide interface=
"org.osgi.service.event.EventHandler"/>
</service>
<component>
as far as I understand here the property "event.topics" is set to
"some/topic". I have tried to set the property for my service in the
similar manner but it does not work.
But if I register my service the "usual" way. For example, like this:
IHandler impl = new HandlerImpl();
Hashtable properties = new Hashtable(1);
properties.put("type", "normal");
reg = context.registerService(IHandler.class.getName(), impl,
properties);
Then the property gets set. Am I doing something wrong?
best regards,
Sergey Mylnikov
|
|
|
|
Powered by
FUDForum. Page generated in 0.02652 seconds