protected static IServerType getCompatibleServerType(IRuntimeType runtimeType) { List list = new ArrayList(); IServerType[] serverTypes = ServerCore.getServerTypes(); int size = serverTypes.length; for (int i = 0; i < size; i++) { IRuntimeType rt = serverTypes[i].getRuntimeType(); if (rt != null && rt.equals(runtimeType)) list.add(serverTypes[i]); } if (list.size() == 1) return (IServerType) list.get(0); return null; }
protected boolean hasRuntime(IServerType serverType) { return hasRuntime(serverType.getRuntimeType()); }
protected boolean matchesServerType(IServerType st) { String text = st.getDescription(); if (wordMatches(text)) return true; if (st.getRuntimeType() != null && matchesRuntimeType(st.getRuntimeType())) return true; return false; }
protected boolean checkForNonStubEnvironmentRuntime(IServerType serverType) { IRuntimeType runtimeType = serverType.getRuntimeType(); IRuntime[] runtimes = ServerUIPlugin.getRuntimes(runtimeType); if (runtimes == null || runtimes.length == 0) return false; int size = runtimes.length; for (int i = 0; i < size; i++) { if (!runtimes[i].isStub()) return true; } return false; }
/** * Returns a list of all servers that this module is configured on. * * @param module org.eclipse.wst.server.core.IModule * @return java.util.List */ protected static IServer[] getServersBySupportedModule(IModule module) { if (module == null) return new IServer[0]; // do it the slow way - go through all servers and // see if this module is configured in it List list = new ArrayList(); IServer[] servers = ServerCore.getServers(); if (servers != null) { int size = servers.length; for (int i = 0; i < size; i++) { if (servers[i].getServerType() != null && servers[i].getServerType().getRuntimeType() != null && ServerUtil.isSupportedModule(servers[i].getServerType().getRuntimeType().getModuleTypes(), module.getModuleType())) list.add(servers[i]); } } IServer[] allServers = new IServer[list.size()]; list.toArray(allServers); return allServers; }
/** * Returns true if the given server type can launch the module. */ protected boolean isValidServerType(IServerType type, IModule module) { try { IRuntimeType runtimeType = type.getRuntimeType(); ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), module.getModuleType()); } catch (Exception e) { return false; } return true; } }
public void fillTree() { clean(); List list = new ArrayList(); IServerType[] serverTypes = ServerCore.getServerTypes(); if (serverTypes != null) { int size = serverTypes.length; for (int i = 0; i < size; i++) { IServerType serverType = serverTypes[i]; if (include(serverType)) { try { IRuntimeType runtimeType = serverType.getRuntimeType(); TreeElement ele = getOrCreate(list, runtimeType.getVendor()); ele.contents.add(serverType); elementToParentMap.put(serverType, ele); } catch (Exception e) { Trace.trace(Trace.WARNING, "Error in server configuration content provider", e); } } } } elements = list.toArray(); }
IRuntimeType runtimeType = serverType.getRuntimeType(); if (runtimeType != null)
for (int j=0; j<rts.length; j++) if (st == null || st.getRuntimeType() == null) break; org.eclipse.wst.server.core.IRuntime rt = rts[j]; String serverTypeRuntimeTypeId = st.getRuntimeType().getId();
Iterator itr = runtimes.iterator(); IServerType st = ServerCore.findServerType(serverFactoryId); String runtimeTypeId = st.getRuntimeType().getId(); while (itr.hasNext())
protected void updateRuntimeCombo() { IRuntimeType runtimeType = server.getServerType().getRuntimeType(); runtimes = ServerUIPlugin.getRuntimes(runtimeType); if (SocketUtil.isLocalhost(server.getHost()) && runtimes != null) { List runtimes2 = new ArrayList(); int size = runtimes.length; for (int i = 0; i < size; i++) { IRuntime runtime2 = runtimes[i]; if (!runtime2.isStub()) runtimes2.add(runtime2); } runtimes = new IRuntime[runtimes2.size()]; runtimes2.toArray(runtimes); } int size = runtimes.length; String[] items = new String[size]; for (int i = 0; i < size; i++) items[i] = runtimes[i].getName(); runtimeCombo.setItems(items); }
return; IRuntimeType runtimeType = serverType.getRuntimeType(); runtimes = ServerUIPlugin.getRuntimes(runtimeType); newRuntime = null;
IModule[] modules2 = ServerUtil.getModules(server.getServerType().getRuntimeType().getModuleTypes()); if (modules != null) { int size = modules2.length;
/** * Sort two server types. * * @param s1 the first server type * @param s2 the second server type * @return a negative number if the first element is less than the * second element; the value <code>0</code> if the first element is * equal to the second element; and a positive number if the first * element is greater than the second element */ protected int compareServerTypes(IServerType s1, IServerType s2) { IRuntimeType r1 = s1.getRuntimeType(); IRuntimeType r2 = s2.getRuntimeType(); if (r1 != null && r2 != null) { if (isSameFamily(s1.getName(), r1.getVersion(), s2.getName(), r2.getVersion())) return compareVersions(r1.getVersion(), r2.getVersion()); } return s1.getName().compareToIgnoreCase(s2.getName()); } }
public void selectionChanged(SelectionChangedEvent event) { Object obj = getSelection(event.getSelection()); if (obj instanceof IServer) { selection = (IServer) obj; setDescription(selection.getServerType().getRuntimeType().getDescription()); } else { selection = null; setDescription(""); } listener.serverSelected(selection); } });
protected boolean isExistingServer() { if (module == null || launchMode == null) return false; IServer[] servers = ServerCore.getServers(); if (servers != null) { int size = servers.length; for (int i = 0; i < size; i++) { IModuleType mt = module.getModuleType(); if (ServerUIPlugin.isCompatibleWithLaunchMode(servers[i], launchMode) && ServerUtil.isSupportedModule(servers[i].getServerType().getRuntimeType().getModuleTypes(), mt)) return true; } } return false; }
protected boolean acceptServer(IServer server) { if (module == null || launchMode == null) return true; if (!ServerUIPlugin.isCompatibleWithLaunchMode(server, launchMode)) return false; IModuleType mt = module.getModuleType(); if (includeIncompatibleVersions) { if (!ServerUtil.isSupportedModule(server.getServerType().getRuntimeType().getModuleTypes(), mt.getId(), null)) return false; } else { if (!ServerUtil.isSupportedModule(server.getServerType().getRuntimeType().getModuleTypes(), mt.getId(), mt.getVersion())) return false; } return true; } }
IServerType serverType = server.getServerType(); IModuleType mt = module.getModuleType(); if (!ServerUtil.isSupportedModule(serverType.getRuntimeType().getModuleTypes(), mt)) { String type = mt.getName(); return new Status(IStatus.ERROR, ServerUIPlugin.PLUGIN_ID, NLS.bind(Messages.errorVersionLevel, new Object[] { type, mt.getVersion() }));
protected boolean include(IServerType serverType) { if (serverTypeId != null && !serverType.getId().startsWith(serverTypeId)) return false; IRuntimeType runtimeType = serverType.getRuntimeType(); if (runtimeType == null) return false; String moduleTypeId = null; if (moduleType != null) moduleTypeId = moduleType.getId(); if (includeIncompatibleVersions) { if (!ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), moduleTypeId, null)) return false; } else { String moduleVersion = null; if (moduleType != null) moduleVersion = moduleType.getVersion(); if (!ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), moduleTypeId, moduleVersion)) return false; } if (localhost || serverType.supportsRemoteHosts()) return true; return false; }
boolean wrong = false; if (serverType != null && moduleType != null) { IRuntimeType runtimeType = serverType.getRuntimeType(); if (!ServerUtil.isSupportedModule(runtimeType.getModuleTypes(), moduleType)) { serverType = null;