本文整理汇总了Java中org.eclipse.wst.server.core.IServer.getServerType方法的典型用法代码示例。如果您正苦于以下问题:Java IServer.getServerType方法的具体用法?Java IServer.getServerType怎么用?Java IServer.getServerType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.wst.server.core.IServer
的用法示例。
在下文中一共展示了IServer.getServerType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findExistingServers
import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
/**
* Look for servers that may match.
*
* @param modules the web modules to search for
* @param exact if true, look for exact module match
* @return an existing server
*/
@VisibleForTesting
public Collection<IServer> findExistingServers(IModule[] modules, boolean exact,
SubMonitor progress) {
if (modules.length == 1) {
IServer defaultServer = ServerCore.getDefaultServer(modules[0]);
if (defaultServer != null && LocalAppEngineServerDelegate.SERVER_TYPE_ID
.equals(defaultServer.getServerType().getId())) {
return Collections.singletonList(defaultServer);
}
}
Set<IModule> myModules = ImmutableSet.copyOf(modules);
List<IServer> matches = new ArrayList<>();
// Look for servers that contain these modules
// Could prioritize servers that have *exactly* these modules,
// or that have the smallest overlap
for (IServer server : ServerCore.getServers()) {
// obsolete or unavailable server definitions have serverType == null
if (server.getServerType() == null
|| !LocalAppEngineServerDelegate.SERVER_TYPE_ID.equals(server.getServerType().getId())) {
continue;
}
Set<IModule> serverModules = ImmutableSet.copyOf(server.getModules());
SetView<IModule> overlap = Sets.intersection(myModules, serverModules);
if (overlap.size() == myModules.size()
&& (!exact || overlap.size() == serverModules.size())) {
matches.add(server);
}
}
return matches;
}
示例2: doesServerBelongToHost
import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
public static boolean doesServerBelongToHost(IServer server, IHost host) {
if (host != null && server != null) {
IRSESystemType rseSystem = host.getSystemType();
IServerType serverType = server.getServerType();
if (rseSystem != null) {
String hostSystemType = rseSystem.getId();
if (serverType != null && serverType.getId() != null) {
String serverSystemType = CloudFoundryBrandingExtensionPoint.getRemoteSystemTypeId(serverType.getId());
return (hostSystemType != null && hostSystemType.equals(serverSystemType));
}
}
}
return false;
}
示例3: serverAdded
import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
@Override
public void serverAdded(IServer server) {
if (server.getServerType() != null && IWildFlySwarmConstants.SERVER_TYPE.equals(server.getServerType().getId())) {
ViewUtils.showServersView();
}
}