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


Java IStateListener类代码示例

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


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

import org.hawk.core.IStateListener; //导入依赖的package包/类
protected void fireState() {
	switch (currentState) {
	case RUNNING:
		stateListener.state(IStateListener.HawkState.RUNNING);
		break;
	case STOPPED:
		stateListener.state(IStateListener.HawkState.STOPPED);
		break;
	case UPDATING:
		stateListener.state(IStateListener.HawkState.UPDATING);
		break;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:14,代码来源:ThriftRemoteModelIndexer.java

示例6: 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

示例7: 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

示例8: remove

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public boolean remove(Object e) {
	final boolean ret = super.remove(e);
	if (ret) {
		((IStateListener) e).removed();
	}
	return ret;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:9,代码来源:CompositeStateListener.java

示例9: info

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public void info(String s) {
	for (IStateListener l : this) {
		l.info(s);
	}
	LOGGER.info(s);
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:8,代码来源:CompositeStateListener.java

示例10: error

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public void error(String s) {
	for (IStateListener l : this) {
		l.error(s);
	}
	LOGGER.error(s);
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:8,代码来源:CompositeStateListener.java

示例11: addStateListener

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public boolean addStateListener(IStateListener l) {
	return stateListener.add(l);
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:5,代码来源:ThriftRemoteModelIndexer.java

示例12: removeStateListener

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public boolean removeStateListener(IStateListener l) {
	return stateListener.remove(l);
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:5,代码来源:ThriftRemoteModelIndexer.java

示例13: add

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public boolean add(IStateListener e) {
	final boolean ret = super.add(e);
	e.state(currentState);
	return ret;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:7,代码来源:CompositeStateListener.java

示例14: addStateListener

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public boolean addStateListener(IStateListener listener) {
	final boolean ret = stateListener.add(listener);
	return ret;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:6,代码来源:ModelIndexerImpl.java

示例15: removeStateListener

import org.hawk.core.IStateListener; //导入依赖的package包/类
@Override
public boolean removeStateListener(IStateListener listener) {
	return stateListener.remove(listener);
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:5,代码来源:ModelIndexerImpl.java


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