public void runProjectReadiness(NamedRunnable task) { if (executionEnvironment.isLocal() || isCodeModelInfoReady) { task.run(); } else { tasks.add(task); final ServerRecord record = ServerList.get(executionEnvironment); if (record.isOffline()) { ConnectionNotifier.addTask(executionEnvironment, new ConnectionNotifier.NamedRunnable(task.getName()) { @Override protected void runImpl() { record.checkSetupAfterConnection(new Runnable(){ @Override public void run() { ToolsCacheManager cacheManager = ToolsCacheManager.createInstance(true); CompilerSetManager csm = cacheManager.getCompilerSetManagerCopy(record.getExecutionEnvironment(), false); csm.initialize(false, true, null); cacheManager.applyChanges(); } }); } }); } } }
@Override public void runTask(ExecutionEnvironment executionEnvironment, boolean isComplete, NamedRunnable task) { if (executionEnvironment.isLocal() || isComplete) { task.run(); } else { tasks.add(task); final ServerRecord record = ServerList.get(executionEnvironment); if (record.isOffline()) { ConnectionNotifier.addTask(executionEnvironment, new ConnectionNotifier.NamedRunnable(task.getName()) { @Override protected void runImpl() { record.checkSetupAfterConnection(new Runnable() { @Override public void run() { ToolsCacheManager cacheManager = ToolsCacheManager.createInstance(true); CompilerSetManager csm = cacheManager.getCompilerSetManagerCopy(record.getExecutionEnvironment(), false); csm.initialize(false, true, null); cacheManager.applyChanges(); } }); } }); } } }
protected static boolean checkConnection(ExecutionEnvironment execEnv) { if (execEnv.isRemote()) { try { ConnectionManager.getInstance().connectTo(execEnv); ServerRecord record = ServerList.get(execEnv); if (record.isOffline()) { record.validate(true); } return record.isOnline(); } catch (IOException ex) { return false; } catch (CancellationException ex) { return false; } } else { return true; } }
public static boolean checkConnection(ExecutionEnvironment execEnv) { if (execEnv.isRemote()) { try { ConnectionManager.getInstance().connectTo(execEnv); ServerRecord record = ServerList.get(execEnv); if (record.isOffline()) { record.validate(true); } return record.isOnline(); } catch (IOException ex) { return false; } catch (CancellationException ex) { return false; } } else { return true; } }
final boolean wasOffline = record.isOffline(); if (wasOffline) { CompilerSetReporter.report("CSM_Conn", false, executionEnvironment.getHost()); //NOI18N