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


Java IStateListener.HawkState方法代码示例

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


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

示例1: waitFor

import org.hawk.core.IStateListener; //导入方法依赖的package包/类
@Override
public void waitFor(IStateListener.HawkState targetState, long timeoutMillis) throws InterruptedException {
	synchronized (stateListener) {
		final long end = System.currentTimeMillis() + timeoutMillis;
		for (IStateListener.HawkState s = stateListener.getCurrentState(); s != targetState; s = stateListener.getCurrentState()) {
			if (s == IStateListener.HawkState.STOPPED) {
				throw new IllegalStateException("The selected Hawk is stopped");
			}

			if (timeoutMillis == 0) {
				stateListener.wait();
			} else {
				final long remaining = end - System.currentTimeMillis();
				if (remaining > 0) {
					// Wait for the remaining time
					stateListener.wait(remaining);
				} else {
					// Exit the loop due to timeout
					break;
				}
			}
		}
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:25,代码来源:ThriftRemoteModelIndexer.java

示例2: listInstances

import org.hawk.core.IStateListener; //导入方法依赖的package包/类
@Override
public InstanceInfo[] listInstances(String location) throws Exception {
	final Hawk.Client client = getClient(location);

	final List<HawkInstance> instances = client.listInstances();
	final InstanceInfo[] infos = new InstanceInfo[instances.size()];
	for (int iInfo = 0; iInfo < instances.size(); ++iInfo) {
		HawkInstance instance = instances.get(iInfo);

		IStateListener.HawkState hawkState = HawkState.STOPPED;
		switch (instance.state) {
		case RUNNING:
			hawkState = HawkState.RUNNING;
			break;
		case STOPPED:
			hawkState = HawkState.STOPPED;
			break;
		case UPDATING:
			hawkState = HawkState.UPDATING;
			break;
		}
		infos[iInfo] = new InstanceInfo(instance.name, null, hawkState);
	}

	return infos;
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:27,代码来源:ThriftRemoteHawkFactory.java

示例3: mapHawkStateToThrift

import org.hawk.core.IStateListener; //导入方法依赖的package包/类
public static uk.ac.york.mondo.integration.api.HawkState mapHawkStateToThrift(IStateListener.HawkState state) {
	switch (state) {
	case RUNNING: return uk.ac.york.mondo.integration.api.HawkState.RUNNING;
	case UPDATING: return uk.ac.york.mondo.integration.api.HawkState.UPDATING;
	default: return uk.ac.york.mondo.integration.api.HawkState.STOPPED;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:8,代码来源:ArtemisProducerStateListener.java

示例4: mapThriftStateToHawk

import org.hawk.core.IStateListener; //导入方法依赖的package包/类
public static IStateListener.HawkState mapThriftStateToHawk(uk.ac.york.mondo.integration.api.HawkState state) {
	switch (state) {
	case RUNNING: return IStateListener.HawkState.RUNNING;
	case UPDATING: return IStateListener.HawkState.UPDATING;
	default: return IStateListener.HawkState.STOPPED;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:8,代码来源:ArtemisProducerStateListener.java

示例5: mapHawkStateToThrift

import org.hawk.core.IStateListener; //导入方法依赖的package包/类
public static org.hawk.service.api.HawkState mapHawkStateToThrift(IStateListener.HawkState state) {
	switch (state) {
	case RUNNING: return org.hawk.service.api.HawkState.RUNNING;
	case UPDATING: return org.hawk.service.api.HawkState.UPDATING;
	default: return org.hawk.service.api.HawkState.STOPPED;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:8,代码来源:ArtemisProducerStateListener.java

示例6: mapThriftStateToHawk

import org.hawk.core.IStateListener; //导入方法依赖的package包/类
public static IStateListener.HawkState mapThriftStateToHawk(org.hawk.service.api.HawkState state) {
	switch (state) {
	case RUNNING: return IStateListener.HawkState.RUNNING;
	case UPDATING: return IStateListener.HawkState.UPDATING;
	default: return IStateListener.HawkState.STOPPED;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:8,代码来源:ArtemisProducerStateListener.java


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