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


Java IServerType类代码示例

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


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


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