My goal is to create a Maven project with recovery service with Eclipse. Then pack it as a kit and deploy it into the Fuse ESB karaf OSGi container. So far, I know how to use the JAX-RS API annotations, @Path @GET:
package com.restfultest; import javax.ws.rs.GET; import javax.ws.rs.Path; @Path("/example") public class ExampleService { @GET public String sayHello() { return "Hello Restful service"; } }
My question is: 1. What maven archetype should I use? maven-archetype-webapp or quickstart?
2. How to implement the Activator? Like this?
public class Activator implements BundleActivator { private ServiceRegistration<?> registration; public void start(BundleContext context) throws Exception {
3. How to register and publish the service (for example, how to configure the address and port of the endpoint)?
I am new to osgi. Can anyone provide me some resources or a detailed tutorial?
source share