當前位置: 首頁>>代碼示例>>Java>>正文


Java HawkProperties類代碼示例

本文整理匯總了Java中org.hawk.core.util.HawkProperties的典型用法代碼示例。如果您正苦於以下問題:Java HawkProperties類的具體用法?Java HawkProperties怎麽用?Java HawkProperties使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HawkProperties類屬於org.hawk.core.util包,在下文中一共展示了HawkProperties類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDummyProperties

import org.hawk.core.util.HawkProperties; //導入依賴的package包/類
private void createDummyProperties(File parentFolder) throws IOException {
	if (parentFolder.exists()) {
		return;
	}

	parentFolder.mkdirs();
	HawkProperties props = new HawkProperties();
	props.setDbType("dummy");
	props.setMonitoredVCS(new ArrayList<String[]>());

	XStream stream = new XStream(new DomDriver());
	stream.processAnnotations(HawkProperties.class);
	String out = stream.toXML(props);
	try (BufferedWriter b = new BufferedWriter(new FileWriter(
			getParentFolder() + File.separator + "properties.xml"))) {
		b.write(out);
		b.flush();
	}
}
 
開發者ID:mondo-project,項目名稱:mondo-integration,代碼行數:20,代碼來源:ThriftRemoteModelIndexer.java

示例2: saveIndexer

import org.hawk.core.util.HawkProperties; //導入依賴的package包/類
public void saveIndexer() throws Exception {
	stateListener.info("Saving Hawk metadata...");
	XStream stream = new XStream(new DomDriver());
	stream.processAnnotations(HawkProperties.class);

	HashSet<String[]> set = new HashSet<String[]>();
	for (IVcsManager s : getRunningVCSManagers()) {
		String[] meta = new String[] { s.getLocation(), s.getType(), s.isFrozen() + "" };
		console.println("adding: " + meta[0] + ":" + meta[1] + ":" + meta[2]);
		set.add(meta);
	}
	HawkProperties hp = new HawkProperties(graph.getType(), set, minDelay, maxDelay);

	Files.createDirectories(getParentFolder().toPath());
	String out = stream.toXML(hp);
	try (BufferedWriter b = new BufferedWriter(
			new FileWriter(getParentFolder() + File.separator + "properties.xml"))) {
		b.write(out);
		b.flush();
	}
	stateListener.info("Saved Hawk metadata.");
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:23,代碼來源:ModelIndexerImpl.java

示例3: start

import org.hawk.core.util.HawkProperties; //導入依賴的package包/類
public boolean start(HManager manager) {
	try {
		final HawkProperties hp = loadIndexerMetadata();

		if (hawkFactory.instancesCreateGraph()) {
			// create the indexer with relevant database
			IGraphDatabase db = manager.createGraph(hawk);
			db.run(new File(this.getFolder()), getConsole());
			hawk.getModelIndexer().setDB(db, false);
		}

		hawk.getModelIndexer().init(hp.getMinDelay(), hp.getMaxDelay());
	} catch (Exception e) {
		getConsole().printerrln(e);
	}

	boolean running = hawk.getModelIndexer().isRunning();

	return running;
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:21,代碼來源:HModel.java

示例4: listInstances

import org.hawk.core.util.HawkProperties; //導入依賴的package包/類
@Override
public InstanceInfo[] listInstances(String location) {
	final File basePath = new File(location);

	final List<InstanceInfo> entries = new ArrayList<>();
	if (basePath.exists()) {
		for (File f : basePath.listFiles()) {
			if (f.isDirectory()) {
				File fProps = new File(f, "properties.xml");
				if (fProps.canRead()) {
					try {
						XStream stream = new XStream(new DomDriver());
						stream.processAnnotations(HawkProperties.class);
						stream.setClassLoader(HawkProperties.class.getClassLoader());

						HawkProperties hp = (HawkProperties) stream.fromXML(fProps);
						entries.add(new InstanceInfo(f.getName(), hp.getDbType(), HawkState.STOPPED));
					} catch (Exception ex) {
						ex.printStackTrace();
					}
				}
			}
		}
	} else {
		System.err.println(basePath + " does not exist: returning an empty set");
	}
	return entries.toArray(new InstanceInfo[entries.size()]);
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:29,代碼來源:LocalHawkFactory.java

示例5: loadIndexerMetadata

import org.hawk.core.util.HawkProperties; //導入依賴的package包/類
private HawkProperties loadIndexerMetadata() throws Exception {
	XStream stream = new XStream(new DomDriver());
	stream.processAnnotations(HawkProperties.class);
	stream.setClassLoader(HawkProperties.class.getClassLoader());
	String path = hawk.getModelIndexer().getParentFolder() + File.separator + "properties.xml";

	HawkProperties hp = (HawkProperties) stream.fromXML(new File(path));
	hawk.setDbtype(hp.getDbType());
	for (String[] s : hp.getMonitoredVCS()) {
		loadVCS(s[0], s[1], s.length > 2 ? Boolean.parseBoolean(s[2]) : false);
	}

	return hp;
}
 
開發者ID:mondo-project,項目名稱:mondo-hawk,代碼行數:15,代碼來源:HModel.java


注:本文中的org.hawk.core.util.HawkProperties類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。