当前位置: 首页>>代码示例>>Java>>正文


Java IServer.getServerType方法代码示例

本文整理汇总了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;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:38,代码来源:LaunchHelper.java

示例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;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:15,代码来源:CloudFoundryRsePlugin.java

示例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();
	}
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:7,代码来源:WildFlyServerListener.java


注:本文中的org.eclipse.wst.server.core.IServer.getServerType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。