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