Activator.java 851 B

123456789101112131415161718192021222324252627
  1. package at.acdp.opcur.ur;
  2. import at.acdp.opcur.opc.Server;
  3. import com.ur.urcap.api.contribution.installation.swing.SwingInstallationNodeService;
  4. import com.ur.urcap.api.contribution.program.swing.SwingProgramNodeService;
  5. import org.osgi.framework.BundleActivator;
  6. import org.osgi.framework.BundleContext;
  7. public class Activator implements BundleActivator {
  8. @Override
  9. public void start(final BundleContext context) throws Exception {
  10. context.registerService(SwingInstallationNodeService.class, new HelloWorldInstallationNodeService(), null);
  11. context.registerService(SwingProgramNodeService.class, new HelloWorldProgramNodeService(), null);
  12. new Thread(() -> {
  13. try {
  14. Server.main(null);
  15. } catch (Exception e) {
  16. e.printStackTrace();
  17. }
  18. }).start();
  19. }
  20. @Override
  21. public void stop(BundleContext context) throws Exception {
  22. }
  23. }