121314151617181920212223
public void start(BundleContext bc) throws IOException { ServiceReference sRef = bc.getServiceReference(UserService.class.getName()); if (sRef != null) { UserService us = (UserService) bc.getService(sRef); if (us != null) { us.login("joek"); } bc.ungetService(sRef); } }
252627282930313233343536
public void stop(BundleContext bc) throws IOException { ServiceReference sRef = bc.getServiceReference(UserService.class.getName()); if (sRef != null) { UserService us = (UserService) bc.getService(sRef); if (us != null) { us.logout(); } bc.ungetService(sRef); } }