(省略) public class ServiceActivator implements BundleActivator { private ServiceRegistration registration; public void start(BundleContext context) throws Exception { //リスト2-1 System.out.println("Hello OSGi Service!"); INotificationService service = new HelloNotificationService(); registration = context.registerService(INotificationService.class.getName(), service, new Hashtable()); //リスト 2-2 } public void stop(BundleContext context) throws Exception { //リスト2-3 registration.unregister();@ System.out.println("Goodbye OSGi Service."); } }