Activator.java 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. package uraxis;
  2. import org.osgi.framework.BundleActivator;
  3. import org.osgi.framework.BundleContext;
  4. import com.ur.urcap.api.contribution.InstallationNodeService;
  5. import com.ur.urcap.api.contribution.ProgramNodeService;
  6. import com.ur.urcap.api.contribution.DaemonService;
  7. /**
  8. * Hello world activator for the OSGi bundle URCAPS contribution
  9. *
  10. */
  11. public class Activator implements BundleActivator {
  12. @Override
  13. public void start(BundleContext context) throws Exception {
  14. System.out.println("Activator says Hello World!");
  15. MyDaemonDaemonService daemonService = new MyDaemonDaemonService();
  16. MyDaemonInstallationNodeService installationNodeService = new MyDaemonInstallationNodeService(daemonService);
  17. context.registerService(InstallationNodeService.class, installationNodeService, null);
  18. context.registerService(ProgramNodeService.class, new MyDaemonProgramNodeService(), null);
  19. context.registerService(DaemonService.class, daemonService, null);
  20. }
  21. @Override
  22. public void stop(BundleContext bundleContext) throws Exception {
  23. System.out.println("Activator says Goodbye World!");
  24. }
  25. }