java - Declarative OSGi Services -
i have question declarative osgi services. have following interface :
public interface printservice { public void print(); }
and implementation:
public class printserviceimpl implements printservice { @override public void print() { system.out.println("hello printserviceimpl!"); } }
osgi-inf/component.xml :
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="service"> <implementation class="service.printserviceimpl"/> <service> <provide interface="print.printservice"/> </service> </scr:component>
manifest.mf :
service-component: osgi-inf/component.xml
after install service , start nothing happend. how can activate , print "hello printserviceimpl!" console.
why expect print
method invoked? part of interface of service, not invoked until can client binds , calls it.
if type services
command in console should see bundle publishing print.printservice
service; means component working. if don't see may missing scr bundle suggested tom seidel in comments above.
Comments
Post a Comment