• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IServerType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.wst.server.core.IServerType的典型用法代码示例。如果您正苦于以下问题:Java IServerType类的具体用法?Java IServerType怎么用?Java IServerType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IServerType类属于org.eclipse.wst.server.core包,在下文中一共展示了IServerType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createRuntime

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
protected IRuntime createRuntime(IServerType st, IPath path, IProgressMonitor monitor, IOverwriteQuery query)
		throws CoreException {
	IRuntime runtime = ServerCore.findRuntime(runtimeName);
	if (runtime != null) {
		if (!query(query, NLS.bind(Messages.ServerHandler_QUERY_RUNTIME_EXISTS,
				runtimeName))) {
			monitor.worked(1);
			return runtime;
		}
		else {
			runtime.delete();
		}
	}
	IRuntimeWorkingCopy wc = st.getRuntimeType().createRuntime(runtimeName, new SubProgressMonitor(monitor, 1));
	wc.setName(runtimeName);

	if (path != null) {
		wc.setLocation(path);
	}

	runtime = wc.save(true, new SubProgressMonitor(monitor, 1));

	return runtime;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:25,代码来源:ServerHandler.java


示例2: createServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private IServer createServer(IServerType st, IRuntime runtime, IProgressMonitor monitor, IOverwriteQuery query,
		ServerHandlerCallback callback) throws CoreException {
	IServer server = ServerCore.findServer(serverName);
	if (server != null) {
		if (!query(query,
				NLS.bind(Messages.ServerHandler_QUERY_SERVER_EXISTS, serverName))) {
			monitor.worked(1);
			return server;
		}
		else {
			IFolder serverConfiguration = server.getServerConfiguration();
			server.delete();
			if (serverConfiguration != null) {
				serverConfiguration.delete(true, true, monitor);
			}
		}
	}

	IServerWorkingCopy wc = st.createServer(serverName, null, runtime, new SubProgressMonitor(monitor, 1));
	wc.setName(serverName);
	if (callback != null) {
		callback.configureServer(wc);
	}
	server = wc.save(true, new SubProgressMonitor(monitor, 1));
	return server;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:27,代码来源:ServerHandler.java


示例3: handlePropertyChanged

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
/**
 * Allow UI Control to react based on a property change and change the UI
 * control.
 * 
 * @param event
 *            property change event that describes the change.
 */
public void handlePropertyChanged(PropertyChangeEvent event) {
	if (event != null
			&& AbstractUIControl.PROP_SERVER_TYPE.equals(event
					.getPropertyName())) {
		Object curNewValue = event.getNewValue();

		if (curNewValue == null || curNewValue instanceof IServerType && isSupportedServerType((IServerType)curNewValue)) {
			// Disable the host name field.
			if (controlListener != null) {
				controlMap.put(PROP_HOSTNAME, new UIControlEntry(false, null));
				fireUIControlChangedEvent();
			}
		} else {
			// Enable the host name field.
			if (controlListener != null) {
				controlMap.put(PROP_HOSTNAME, new UIControlEntry(true,
								null));
				fireUIControlChangedEvent();
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:30,代码来源:CloudFoundryServerEditorOverviewPageUIControl.java


示例4: searchForServers

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
public void searchForServers(String host, final IServerSearchListener listener, final IProgressMonitor monitor)
{

    JettyRuntimeLocator.IRuntimeSearchListener listener2 = new JettyRuntimeLocator.IRuntimeSearchListener()
    {
        public void runtimeFound(IRuntimeWorkingCopy runtime)
        {
            String runtimeTypeId = runtime.getRuntimeType().getId();
            String serverTypeId = runtimeTypeId.substring(0,runtimeTypeId.length() - 8);
            IServerType serverType = ServerCore.findServerType(serverTypeId);
            try
            {
                IServerWorkingCopy server = serverType.createServer(serverTypeId,null,runtime,monitor);
                listener.serverFound(server);
            }
            catch (Exception e)
            {
                Trace.trace(Trace.WARNING,"Could not create Jetty server",e);
            }
        }
    };
    
    JettyRuntimeLocator.searchForRuntimes2(null,listener2,monitor);
}
 
开发者ID:bengalaviz,项目名称:JettyWTPPlugin,代码行数:25,代码来源:JettyServerLocator.java


示例5: createServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private static IServerWorkingCopy createServer(
		IProgressMonitor progressMonitor, IRuntime runtime, String name)
		throws CoreException {
	IServerType serverType = ServerCore
			.findServerType("org.eclipse.jst.server.tomcat.60");
	ServerWorkingCopy server = (ServerWorkingCopy) serverType.createServer(
			null, null, runtime, progressMonitor);
	server.setStartTimeout(450);
	server.setStopTimeout(150);
	server.setAutoPublishSetting(2);
	TomcatServer tomcatServer = (TomcatServer) server
			.getWorkingCopyDelegate(null);
	tomcatServer.setServeModulesWithoutPublish(true);
	tomcatServer.setSaveSeparateContextFiles(true);
	server.setHost(AS_HOST);
	if (name != null) {
		server.setName(name);
	} else {
		server.setName(AS_NAME);
	}
	ServerUIPreferences serverUIPreferences = ServerUIPreferences
			.getInstance();
	serverUIPreferences.setShowOnActivity(false);
	server.save(false, progressMonitor);
	return server;
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:27,代码来源:TomcatStartup.java


示例6: testPublishingSubmodules

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
/**
 * Verify that multi-web-module works.
 */
@Test
public void testPublishingSubmodules() throws CoreException {
  IServerType serverType =
      ServerCore.findServerType("com.google.cloud.tools.eclipse.appengine.standard.server");
  IServerWorkingCopy serverWorkingCopy =
      serverType.createServer(getClass().getName(), null, null);
  serverWorkingCopy.modifyModules(new IModule[] {serverModule}, null, null);
  server = serverWorkingCopy.saveAll(true, null);
  assertTrue(server.canPublish().isOK());
  assertTrue("publish failed", server.publish(IServer.PUBLISH_CLEAN, null).isOK());

  LocalAppEngineServerBehaviour serverBehaviour =
      server.getAdapter(LocalAppEngineServerBehaviour.class);
  assertNotNull(serverBehaviour);

  // now verify the result
  IPath deployDirectory = serverBehaviour.getModuleDeployDirectory(serverModule);
  File publishedModule = deployDirectory.toFile();
  assertTrue(publishedModule.isDirectory());
  File webInf = new File(publishedModule, "WEB-INF");
  assertTrue(webInf.isDirectory());

  assertTrue(new File(webInf, "appengine-web.xml").isFile());
  assertTrue(new File(webInf, "web.xml").isFile());
  assertTrue(new File(webInf, "classes/sox/server/GreetingServiceImpl.class").isFile());
  assertTrue(new File(webInf, "lib/servlet-2.5.jar").isFile());
  assertTrue(new File(webInf, "lib/sox-shared.jar").isFile());
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:32,代码来源:LocalAppEnginePublishOperationTest.java


示例7: createServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private IServer createServer(IModule[] modules, SubMonitor progress) throws CoreException {
  IServerType serverType = ServerCore.findServerType(LocalAppEngineServerDelegate.SERVER_TYPE_ID);
  IServerWorkingCopy serverWorkingCopy =
      serverType.createServer(null, null, progress.newChild(4));
  serverWorkingCopy.modifyModules(modules, null, progress.newChild(4));
  return serverWorkingCopy.save(false, progress.newChild(2));
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:8,代码来源:LaunchHelper.java


示例8: handlePropertyChanged

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
@Override
public void handlePropertyChanged(PropertyChangeEvent event) {
  if (event != null && event.getNewValue() instanceof IServerType) {
    IServerType serverType = (IServerType) event.getNewValue();
    boolean showPort = LocalAppEngineServerDelegate.SERVER_TYPE_ID.equals(serverType.getId());
    portLabel.setVisible(showPort);
    portText.setVisible(showPort);
    if (showPort) {
      updatePortAndTriggerDecoration(portText.getText());
    } else {
      portDecoration.hide();
    }
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:15,代码来源:ServerPortExtension.java


示例9: createServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
public static IServer createServer(IJavaProject javaProject, String mainClass, IProgressMonitor monitor) throws CoreException {
	String projectName = javaProject.getProject().getName();
	//System.err.println("Creating wildfly server for project " + projectName+ " with main class " + mainClass);
	IServerType type = ServerCore.findServerType(SERVER_TYPE);
	String suffixed = ServerNamingUtility.getDefaultServerName("WildFly Swarm - "+projectName);
	IServerWorkingCopy wc = type.createServer(suffixed, null, monitor);
	wc.setName(suffixed);
	wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
	wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainClass);
	IServer server = wc.save(true, monitor);
	return server;
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:13,代码来源:WildFlySwarmServerHelper.java


示例10: findWildflySwarmServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
public static IServer findWildflySwarmServer(IJavaProject p, IProgressMonitor monitor) {
	IServer[] servers = ServerCore.getServers();
	if (servers.length == 0) {
		return null;
	}
	String projectName = p.getProject().getName();
	IServerType type = ServerCore.findServerType(SERVER_TYPE);
	
	return Arrays.stream(servers)
				 .filter(s -> type.equals(s.getServerType()))
				 .filter(s -> projectName.equals(s.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null)))
				 .findFirst()
				 .orElse(null);
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:15,代码来源:WildFlySwarmServerHelper.java


示例11: findAllWildflySwarmServers

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
public static Collection<IServer> findAllWildflySwarmServers() {
	IServer[] servers = ServerCore.getServers();
	if (servers.length == 0) {
		return Collections.emptyList();
	}
	IServerType type = ServerCore.findServerType(SERVER_TYPE);
	
	return Arrays.stream(servers)
				 .filter(s -> type.equals(s.getServerType()))
				 .collect(Collectors.toList());
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:12,代码来源:WildFlySwarmServerHelper.java


示例12: doesServerBelongToHost

import org.eclipse.wst.server.core.IServerType; //导入依赖的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


示例13: getExistingServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
public IServer getExistingServer() {
	IProgressMonitor monitor = new NullProgressMonitor();
	try {
		IServerType st = ServerCore.findServerType(serverType);
		if (st == null) {
			return null;
		}
		IRuntime runtime;
		if (serverPath != null || forceCreateRuntime) {
			runtime = ServerCore.findRuntime(runtimeName);
			if (runtime == null) {
				return null;
			}
		}
		else {
			runtime = findRuntime(st, monitor);
		}

		if (serverName != null) {
			return ServerCore.findServer(serverName);
		}
		else {
			return findServer(st, runtime, monitor);
		}
	}
	catch (CoreException e) {
		return null;
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:30,代码来源:ServerHandler.java


示例14: findRuntime

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private IRuntime findRuntime(IServerType st, IProgressMonitor monitor) throws CoreException {
	IRuntime[] runtimes = ServerCore.getRuntimes();
	if (runtimes != null) {
		for (IRuntime runtime : runtimes) {
			if (runtime.getRuntimeType().equals(st.getRuntimeType())) {
				return runtime;
			}
		}
	}
	throw new CoreException(CloudFoundryPlugin.getErrorStatus("No matching runtime found")); //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:cft,代码行数:12,代码来源:ServerHandler.java


示例15: findServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private IServer findServer(IServerType st, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
	IServer[] servers = ServerCore.getServers();
	if (servers != null) {
		for (IServer server : servers) {
			if (server.getRuntime().getRuntimeType().equals(st.getRuntimeType())) {
				return server;
			}
		}
	}
	throw new CoreException(CloudFoundryPlugin.getErrorStatus("No matching server found")); //$NON-NLS-1$
}
 
开发者ID:eclipse,项目名称:cft,代码行数:12,代码来源:ServerHandler.java


示例16: handlePropertyChanged

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
/**
 * Allow UI Control to react based on a property change and change the UI
 * control.
 * 
 * @param event
 *            property change event that describes the change.
 */
public void handlePropertyChanged(PropertyChangeEvent event) {
	if (event != null
			&& AbstractUIControl.PROP_SERVER_TYPE.equals(event
					.getPropertyName())) {
		Object curNewValue = event.getNewValue();
		Object curOldValue = event.getOldValue();

		// Only enable user cloud.
		if (curOldValue != curNewValue) {
			if (curNewValue == null || curNewValue instanceof IServerType) {
				if (isSupportedServerType((IServerType)curNewValue)) {
					// Disable the host name field
					if (controlListener != null) {
						controlMap.put(PROP_HOSTNAME, new UIControlEntry(false, null));
						previousHostname = controlListener
								.getControlStringValue(PROP_HOSTNAME);
						fireUIControlChangedEvent();
					}
				} else if (isSupportedServerType((IServerType)curOldValue)) {
					// Re-enable the host name field.
					if (controlListener != null) {
						controlMap.put(PROP_HOSTNAME, new UIControlEntry(true, previousHostname));
						previousHostname = null;
						fireUIControlChangedEvent();
					}
				}
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:38,代码来源:CloudFoundryServerWizardUIControl.java


示例17: isCloudFoundryServerType

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
/**
 * Check if the server type is a Cloud Foundry-based server type
 * @param serverType
 * @return true if it is a Cloud Foundry server type
 */
public static boolean isCloudFoundryServerType(IServerType serverType) {
	if (serverType != null) {
		String serverId = serverType.getId();
		return CloudFoundryBrandingExtensionPoint.getServerTypeIds().contains(serverId);
	}
	return false;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:13,代码来源:CloudServerUtil.java


示例18: isCloudFoundryServerType

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
/**
 * Check if the server type is a Cloud Foundry-based server type
 * @param serverType
 * @return true if it is a Cloud Foundry server type
 */
public static boolean isCloudFoundryServerType(IServerType serverType) {
	if (serverType != null) {
		String serverId = serverType.getId();
		return DockerFoundryBrandingExtensionPoint.getServerTypeIds().contains(serverId);
	}
	return false;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:13,代码来源:CloudServerUtil.java


示例19: findRuntime

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private IRuntime findRuntime(IServerType st, IProgressMonitor monitor) throws CoreException {
	IRuntime[] runtimes = ServerCore.getRuntimes();
	if (runtimes != null) {
		for (IRuntime runtime : runtimes) {
			if (runtime.getRuntimeType().equals(st.getRuntimeType())) {
				return runtime;
			}
		}
	}
	throw new CoreException(DockerFoundryPlugin.getErrorStatus("No matching runtime found")); //$NON-NLS-1$
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:12,代码来源:ServerHandler.java


示例20: findServer

import org.eclipse.wst.server.core.IServerType; //导入依赖的package包/类
private IServer findServer(IServerType st, IRuntime runtime, IProgressMonitor monitor) throws CoreException {
	IServer[] servers = ServerCore.getServers();
	if (servers != null) {
		for (IServer server : servers) {
			if (server.getRuntime().getRuntimeType().equals(st.getRuntimeType())) {
				return server;
			}
		}
	}
	throw new CoreException(DockerFoundryPlugin.getErrorStatus("No matching server found")); //$NON-NLS-1$
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:12,代码来源:ServerHandler.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PolishAnalyzer类代码示例发布时间:2022-05-22
下一篇:
Java QuerySet类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap