protected void handleSelection(IRuntimeType runtimeType) { if (runtimeType == null) runtime = null; else { try { runtime = null; runtime = (IRuntimeWorkingCopy) cache.get(runtimeType); } catch (Exception e) { // ignore } if (runtime == null) { try { runtime = runtimeType.createRuntime(null, null); ServerUtil.setRuntimeDefaultName(runtime); if (runtime != null) cache.put(runtimeType, runtime); } catch (Exception e) { // ignore } } } serverType = getCompatibleServerType(runtimeType); handleServer(); }
protected static IRuntimeWorkingCopy getRuntimeFromDir(File dir, IProgressMonitor monitor) { for (int i = 0; i < runtimeTypes.length; i++) { try { IRuntimeType runtimeType = ServerCore.findRuntimeType(runtimeTypes[i]); String absolutePath = dir.getAbsolutePath(); String id = absolutePath.replace(File.separatorChar,'_').replace(':','-'); IRuntimeWorkingCopy runtime = runtimeType.createRuntime(id, monitor); runtime.setName(dir.getName()); runtime.setLocation(new Path(absolutePath)); ITomcatRuntimeWorkingCopy wc = (ITomcatRuntimeWorkingCopy) runtime.loadAdapter(ITomcatRuntimeWorkingCopy.class, null); wc.setVMInstall(JavaRuntime.getDefaultVMInstall()); IStatus status = runtime.validate(monitor); if (status == null || status.getSeverity() != IStatus.ERROR) return runtime; Trace.trace(Trace.FINER, "False runtime found at " + dir.getAbsolutePath() + ": " + status.getMessage()); } catch (Exception e) { Trace.trace(Trace.SEVERE, "Could not find runtime", e); } } return null; } }
IRuntimeWorkingCopy runtimeWC = runtimeType.createRuntime(null, null); ServerUtil.setRuntimeDefaultName(runtimeWC); runtimes = new IRuntime[1];
if (runtimeType != null) { try { final IRuntimeWorkingCopy runtime = runtimeType.createRuntime(null, null); TaskModel taskModel = new TaskModel(); taskModel.putObject(TaskModel.TASK_RUNTIME, runtime);