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


Java HManager类代码示例

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


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

示例1: stop

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void stop(BundleContext bundleContext) throws Exception {
	Activator.context = null;
	HManager.getInstance().stopAllRunningInstances(
			ShutdownRequestType.ONLY_LOCAL);

	if (artemis != null) {
		artemis.stop();
		artemis = null;
	}

	if (tcpServer != null) {
		tcpServer.stop();
		tcpServer = null;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:17,代码来源:Activator.java

示例2: stop

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void stop(BundleContext bundleContext) throws Exception {

	Activator.context = null;
	
	HManager.getInstance().stopAllRunningInstances(
			ShutdownRequestType.ONLY_LOCAL);
	
	
	if (artemis != null) {
		artemis.stop();
		artemis = null;
	}

	if (tcpServer != null) {
		tcpServer.stop();
		tcpServer = null;
	}
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:20,代码来源:Activator.java

示例3: HawkServerConfigurator

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
public HawkServerConfigurator(Iface iface) {
	this.iface = iface;

	hawkInstanceConfigs = new ArrayList<HawkInstanceConfig>();
	manager = HManager.getInstance();
	parser = new ConfigFileParser();
	numberOfConfiguredInstances = 0;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:9,代码来源:HawkServerConfigurator.java

示例4: getHawkByName

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
private HModel getHawkByName(String name) throws HawkInstanceNotFound {
	final HModel model = HManager.getInstance().getHawkByName(name);
	if (model == null) {
		throw new HawkInstanceNotFound();
	}
	return model;
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:8,代码来源:HawkThriftIface.java

示例5: createInstance

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void createInstance(String name, String backend, int minDelay, int maxDelay, List<String> plugins) throws TException {
	try {
		final HManager manager = HManager.getInstance();
		if (manager.getHawkByName(name) == null) {
			HModel model = HModel.create(new LocalHawkFactory(), name, storageFolder(name),
					null, backend, plugins,
					manager, new SecurePreferencesCredentialsStore(), minDelay, maxDelay);
			addStateListener(model);
		}
	} catch (Exception ex) {
		throw new TException(ex);
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:15,代码来源:HawkThriftIface.java

示例6: listInstances

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<HawkInstance> listInstances() throws TException {
	final List<HawkInstance> instances = new ArrayList<>();
	for (HModel m : HManager.getInstance().getHawks()) {
		final HawkInstance instance = new HawkInstance();
		instance.name = m.getName();
		instance.state = ArtemisProducerStateListener.mapHawkStateToThrift(m.getStatus());
		instance.message = m.getInfo();
		instances.add(instance);
	}
	return instances;
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:13,代码来源:HawkThriftIface.java

示例7: removeInstance

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void removeInstance(String name) throws HawkInstanceNotFound, TException {
	final HModel model = getHawkByName(name);
	try {
		HManager.getInstance().delete(model, true);
		removeStateListener(model);
	} catch (BackingStoreException e) {
		throw new TException(e.getMessage(), e);
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:11,代码来源:HawkThriftIface.java

示例8: startInstance

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public void startInstance(String name) throws HawkInstanceNotFound, TException {
	final HModel model = getHawkByName(name);
	if (!model.isRunning()) {
		model.start(HManager.getInstance());
		addStateListener(model);
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:9,代码来源:HawkThriftIface.java

示例9: connectToArtemis

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
protected void connectToArtemis() {
	if (consumer != null && consumer.isSessionOpen()) {
		return;
	}
	try {
		HawkState currentState = HawkState.RUNNING;
		String currentInfo = "";
		for (HawkInstance instance : client.listInstances()) {
			if (name.equals(instance.getName())) {
				currentState = instance.getState();
				currentInfo = instance.getMessage();
			}
		}

		org.hawk.core.ICredentialsStore.Credentials creds = HManager.getInstance().getCredentialsStore().get(location);
		Subscription subState = client.watchStateChanges(name);
		consumer = APIUtils.connectToArtemis(subState, SubscriptionDurability.TEMPORARY);
		if (creds != null) {
			consumer.openSession(creds.getUsername(), creds.getPassword());
		} else {
			consumer.openSession(null, null);
		}
		consumer.processChangesAsync(new StatePropagationConsumer(currentState, currentInfo));
	} catch (HawkInstanceNotFound nf) {
		/*
		 * Not found yet: this is probably because of a call from the
		 * constructor right before invoking init. This is normal: we
		 * will simply try again once init has invoked createInstance.
		 */
	} catch (Exception e) {
		Activator.logError(e);
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:34,代码来源:ThriftRemoteModelIndexer.java

示例10: setup

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@BeforeClass
static public void setup() {
	initConfigurationFolder();
	setupAndCopyPathsInXmlFile(xmlFileName_1);
	setupAndCopyPathsInXmlFile(xmlFileName_2);
	manager = HManager.getInstance();
	hawkIface = new HawkThriftIface(ThriftProtocol.TUPLE, null, null);
	serverConfigurator = new HawkServerConfigurator(hawkIface);
	serverConfigurator.loadHawkServerConfigurations();		
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:11,代码来源:HawkServerConfiguratorTest.java

示例11: getHawkNames

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
private String[] getHawkNames() {
	final HManager hManager = HUIManager.getInstance();
	final Set<HModel> hawks = hManager.getHawks();
	final List<String> hawkNames = new ArrayList<String>();
	for (HModel hawk : hawks) {
		if (hawk.getGraph() != null) {
			hawkNames.add(hawk.getName());
		}
	}
	Collections.sort(hawkNames);
	final String[] arrHawkNames = hawkNames.toArray(new String[hawkNames.size()]);
	return arrHawkNames;
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:14,代码来源:SelectHawkInstancePage.java

示例12: listRepositoryTypes

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<String> listRepositoryTypes() {
	return new ArrayList<String>(HManager.getInstance().getVCSTypes());
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:5,代码来源:HawkThriftIface.java

示例13: listPlugins

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<String> listPlugins() throws TException {
	return HManager.getInstance().getAvailablePlugins();
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:5,代码来源:HawkThriftIface.java

示例14: listBackends

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
@Override
public List<String> listBackends() throws TException {
	return new ArrayList<>(HManager.getInstance().getIndexTypes());
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:5,代码来源:HawkThriftIface.java

示例15: checkConnected

import org.hawk.osgiserver.HManager; //导入依赖的package包/类
private void checkConnected() {
	if (hawkManager == null) {
		hawkManager = HManager.getInstance();
	}
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:6,代码来源:ServerCommandProvider.java


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