public static IRemoteConnection[] getSuitableConnections() { IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); if (manager == null) return null; ArrayList<IRemoteConnection> suitableConnections = new ArrayList<>(); List<IRemoteConnection> allConnections = manager.getAllRemoteConnections(); for (IRemoteConnection conn : allConnections) { if (conn.hasService(IRemoteCommandShellService.class)) { suitableConnections.add(conn); } } return suitableConnections.toArray(new IRemoteConnection[] {}); }
public static IRemoteConnection getRemoteConnectionByName(String remoteConnection) { if (remoteConnection == null) return null; IRemoteServicesManager manager = Activator.getService(IRemoteServicesManager.class); if (manager == null) { return null; } List<IRemoteConnection> conns = manager.getAllRemoteConnections(); for (IRemoteConnection conn : conns) { if (conn.getName().contentEquals(remoteConnection)) { return conn; } } return null; }
public void stop(BundleContext bundleContext) throws Exception { IRemoteServicesManager remoteManager = getService(IRemoteServicesManager.class); remoteManager.removeRemoteConnectionChangeListener(ArduinoRemoteConnectionListener.INSTANCE); plugin = null; }
public void start(BundleContext bundleContext) throws Exception { plugin = this; IRemoteServicesManager remoteManager = getService(IRemoteServicesManager.class); remoteManager.addRemoteConnectionChangeListener(ArduinoRemoteConnectionListener.INSTANCE); }