本文整理汇总了Java中org.eclipse.wst.server.core.IServerType.createServer方法的典型用法代码示例。如果您正苦于以下问题:Java IServerType.createServer方法的具体用法?Java IServerType.createServer怎么用?Java IServerType.createServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.wst.server.core.IServerType
的用法示例。
在下文中一共展示了IServerType.createServer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: 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;
}
示例4: 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
示例5: 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));
}
示例6: 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;
}