Skip to content

Instantly share code, notes, and snippets.

@hstaudacher
Created February 3, 2014 14:04
Show Gist options
  • Save hstaudacher/8784384 to your computer and use it in GitHub Desktop.
Save hstaudacher/8784384 to your computer and use it in GitHub Desktop.
OSGi-JAX-RS Connector Activator
package osgi.rest.example;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
public class Activator implements BundleActivator {
private ServiceRegistration<ExampleResource> registration;
public void start(BundleContext bundleContext) throws Exception {
registration = bundleContext.registerService(ExampleResource.class, new ExampleResource(), null);
}
public void stop(BundleContext bundleContext) throws Exception {
registration.unregister();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment