當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。