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


Java IServer.getServerState方法代码示例

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


在下文中一共展示了IServer.getServerState方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getActionsFromSelection

import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
@Override
protected List<IAction> getActionsFromSelection(IServer server) {
	CloudFoundryServer cloudFoundryServer = (CloudFoundryServer) server.loadAdapter(CloudFoundryServer.class, null);
	if (cloudFoundryServer == null || server.getServerState() != IServer.STATE_STARTED) {
		return Collections.emptyList();
	}
	List<IAction> actions = new ArrayList<IAction>();

	return actions;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:11,代码来源:ServerMenuActionHandler.java

示例2: getActionsFromSelection

import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
@Override
protected List<IAction> getActionsFromSelection(IServer server) {
	DockerFoundryServer cloudFoundryServer = (DockerFoundryServer) server.loadAdapter(DockerFoundryServer.class, null);
	if (cloudFoundryServer == null || server.getServerState() != IServer.STATE_STARTED) {
		return Collections.emptyList();
	}
	List<IAction> actions = new ArrayList<IAction>();

	
	return actions;
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:12,代码来源:ServerMenuActionHandler.java

示例3: isRunning

import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
private static boolean isRunning(IServer server) {
  return server.getServerState() == IServer.STATE_STARTED
      || server.getServerState() == IServer.STATE_STARTING;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:5,代码来源:LaunchHelper.java

示例4: restartServer

import org.eclipse.wst.server.core.IServer; //导入方法依赖的package包/类
private void restartServer(IServer server, IProgressMonitor monitor) throws CoreException {
	monitor.subTask("Restarting server"); //$NON-NLS-1$

	final CountDownLatch eventLatch = new CountDownLatch(1);
	IServerListener serverListener = new IServerListener() {
		public void serverChanged(ServerEvent event) {
			if (event.getState() == IServer.STATE_STARTED) {
				eventLatch.countDown();
			}
		}
	};

	try {
		server.addServerListener(serverListener);

		if (server.getServerState() != IServer.STATE_STARTED) {
			server.start(ILaunchManager.DEBUG_MODE, monitor);
		}
		else if (server.getServerRestartState()) {
			server.restart(ILaunchManager.DEBUG_MODE, monitor);
		}
		else {
			return;
		}

		// wait 10 seconds
		monitor.subTask("Waiting for server to start"); //$NON-NLS-1$
		for (int i = 0; i < 50; i++) {
			try {
				if (eventLatch.await(200, TimeUnit.MILLISECONDS)) {
					break;
				}
			}
			catch (InterruptedException e) {
				throw new OperationCanceledException();
			}
			if (monitor != null && monitor.isCanceled()) {
				throw new OperationCanceledException();
			}
		}
	}
	finally {
		server.removeServerListener(serverListener);
	}
}
 
开发者ID:eclipse,项目名称:cft,代码行数:46,代码来源:ServerHandler.java


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