Milan, The short answer is that if you want to call this from outside of Karaf, the easiest way to do it is to expose it as a REST or SOAP Web service using CXF and call it that way.
But, if you want to call it from a servlet, why not run that servlet in Karaf? Then you can make the call as a native method call inside Karaf by either just using the class or registering ParserImpl as an OSGi service and performing a service lookup from the Servlet to get a handle on that service. Kevin On Fri, Aug 8, 2014 at 5:04 AM, Milan Tomic <[email protected]> wrote: > Hello, > > I am total beginer with OSGi and Karaf and I am begging here for some help. > > I have followed one tutorial and created one OSGi module, packet it in JAR > and installed it in Karaf with hot deploy: > > public interface ParserService { > String parse(String s); > } > > public class ParserImpl implements ParserService { > public String parse(String s) { > return s.replaceAll("AA", "BB"); > } > } > > Now I have no idea how to call this service from outside of Karaf. Let's > say from an Servlet running inside some Tomcat on the same Windows Server > maching. So, how do you create OSGi/Karaf client app? > > Thank you in advance, > Milan >
