@Override public void onEvent(WorkspaceStatusEvent event) { if (WorkspaceStatus.STOPPED.equals(event.getStatus())) { tokenRegistry.removeTokens(event.getWorkspaceId()); } }
/** {@inheritDoc} */ @Override public final void update(@NotNull ActionEvent event) { Presentation presentation = event.getPresentation(); boolean isWorkspaceRunning = false; if (appContext.get() != null) { Workspace workspace = appContext.get().getWorkspace(); isWorkspaceRunning = workspace != null && WorkspaceStatus.RUNNING.equals(workspace.getStatus()); } boolean inPerspective = perspectives == null || perspectives.isEmpty() ? true : perspectives.contains(perspectiveManager.get().getPerspectiveId()); presentation.setEnabledAndVisible(inPerspective && isWorkspaceRunning); if (inPerspective && isWorkspaceRunning) { updateInPerspective(event); } }
if (!this.status.equals(other.status)) { return false;
long currentlyUsedRamMB = 0; for (WorkspaceImpl activeWorkspace : activeWorkspaces) { if (WorkspaceStatus.STARTING.equals(activeWorkspace.getStatus())) {
@Override public Path getProjectsRoot() { // default root (backward compatible solution) Path projectsRoot = Path.valueOf("/projects"); if (workspace != null && workspace.getStatus().equals(WorkspaceStatus.RUNNING)) { String machineName = wsAgentServerUtilProvider.get().getWsAgentServerMachine().get().getName(); String activeEnv = workspace.getRuntime().getActiveEnv(); EnvironmentImpl environment = workspace.getConfig().getEnvironments().get(activeEnv); VolumeImpl vol = null; if (environment != null) { vol = environment.getMachines().get(machineName).getVolume("projects"); } // if voulme exists return its path, otherwise use backward compatible path (/projects) if (vol != null) { projectsRoot = Path.valueOf(vol.getPath()); } } Log.debug( AppContextImpl.class, "Project Root: " + projectsRoot + " workspace: " + workspace.getConfig().getName()); return projectsRoot; }