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


Java ListValue.getString方法代码示例

本文整理汇总了Java中scouter.lang.value.ListValue.getString方法的典型用法代码示例。如果您正苦于以下问题:Java ListValue.getString方法的具体用法?Java ListValue.getString怎么用?Java ListValue.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scouter.lang.value.ListValue的用法示例。


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

示例1: deleteDbFiles

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@ServiceHandler(RequestCmd.SERVER_DB_DELETE)
public void deleteDbFiles(DataInputX din, DataOutputX dout, boolean login) throws IOException {
	String rootPath = DBCtr.getRootPath();
	MapPack param = (MapPack) din.readPack();
	ListValue fileLv = param.getList("file");
	MapPack m = new MapPack();
	if (fileLv != null) {
		for (int i = 0; i < fileLv.size(); i++) {
			String filename = fileLv.getString(i);
			File file = new File(rootPath + filename);
			deleteFiles(file);
		}
		m.put("size", fileLv.size());
	}
	dout.writeByte(TcpFlag.HasNEXT);
	dout.writePack(m);
	dout.flush();
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:19,代码来源:ManageService.java

示例2: removeDeadGroup

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private void removeDeadGroup(MapPack m) {
	ListValue nameLv = m.getList("name");

	ArrayList<String> grpSet = new ArrayList<String>();
	Iterator<String> enu = traces.keySet().iterator();
	while(enu.hasNext()){
		grpSet.add(enu.next());
	}
	for (int i = 0; i < nameLv.size(); i++) {
		String name = nameLv.getString(i);
		grpSet.remove(name);
	}
	for (String dead : grpSet) {
		final Trace t = traces.get(dead);
		if (t == null) continue;
		ExUtil.exec(canvas, new Runnable() {
			public void run() {
				xyGraph.removeTrace(t);
			}
		});
		traces.remove(dead);
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:AbstractServiceGroupElapsedView.java

示例3: removeDeadGroup

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private void removeDeadGroup(MapPack m) {
	ListValue nameLv = m.getList("name");

	ArrayList<String> grpSet = new ArrayList<String>();
	Enumeration<String> enu =stackValueMap.keys();
	while(enu.hasMoreElements()){
		grpSet.add(enu.nextElement());
	}
	for (int i = 0; i < nameLv.size(); i++) {
		String name = nameLv.getString(i);
		grpSet.remove(name);
	}
	for (String dead : grpSet) {
		stackValueMap.remove(dead);
		final Trace t = traces.get(dead);
		if (t == null) continue;
		ExUtil.exec(canvas, new Runnable() {
			public void run() {
				xyGraph.removeTrace(t);
			}
		});
		traces.remove(dead);
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:25,代码来源:AbstractServiceGroupTPSView.java

示例4: removeObject

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private void removeObject(int objHash, String groupName) {
	Value v = objGroupMap.get(String.valueOf(objHash));
	if (v != null && v instanceof ListValue) {
		ListValue groups = (ListValue) v;
		ListValue newLv = new ListValue();
		for (int i = 0; i < groups.size(); i++) {
			String name = groups.getString(i);
			if (groupName.equals(name)) {
				continue;
			}
			newLv.add(name);
		}
		objGroupMap.put(String.valueOf(objHash), newLv);
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:GroupManager.java

示例5: getObjectList

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public ArrayList<AgentObject> getObjectList(String date, int serverId) {
	ArrayList<AgentObject> agentList = new ArrayList<AgentObject>();
	TcpProxy proxy = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		MapPack out = (MapPack) proxy.getSingle(RequestCmd.OBJECT_LIST_LOAD_DATE, param);
		ListValue objTypeLv = out.getList("objType");
		ListValue objHashLv = out.getList("objHash");
		ListValue objNameLv = out.getList("objName");
		if (objHashLv == null || objHashLv.size() < 0) {
			return agentList;
		}
		for (int i = 0; i < objHashLv.size(); i++) {
			int objHash = (int) objHashLv.getLong(i);
			String objType = objTypeLv.getString(i);
			String objName = objNameLv.getString(i);
			AgentObject agentObject = new AgentObject(objType, objHash, objName,  serverId);
			agentList.add(agentObject);
		}
	} catch (Exception e) {
		ConsoleProxy.errorSafe(e.toString());
	} finally {
		TcpProxy.putTcpProxy(proxy);
	}
	return agentList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:28,代码来源:AgentDailyListProxy.java

示例6: getAgentObject

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public AgentObject getAgentObject(String date, int serverId, int objHash) {
	TcpProxy proxy = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		MapPack out = (MapPack) proxy.getSingle(RequestCmd.OBJECT_LIST_LOAD_DATE, param);
		ListValue objTypeLv = out.getList("objType");
		ListValue objHashLv = out.getList("objHash");
		ListValue objNameLv = out.getList("objName");
		if (objHashLv == null || objHashLv.size() < 0) {
			return null;
		}
		for (int i = 0; i < objHashLv.size(); i++) {
			int hash = (int) objHashLv.getLong(i);
			if (objHash == hash) {
				String objType = objTypeLv.getString(i);
				String objName = objNameLv.getString(i);
				return new AgentObject(objType, objHash, objName,  serverId);
			}
		}
	} catch (Exception e) {
		ConsoleProxy.errorSafe(e.toString());
	} finally {
		TcpProxy.putTcpProxy(proxy);
	}
	return null;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:28,代码来源:AgentDailyListProxy.java

示例7: run

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
	TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
	Pack p = null;
	try {
		p = tcp.getSingle(RequestCmd.LOAD_ALERT_SUMMARY, param);
	} catch (Exception e) {
		e.printStackTrace();
		return Status.CANCEL_STATUS;
	} finally {
		TcpProxy.putTcpProxy(tcp);
	}
	
	if (p != null) {
		final List<AlertData> list = new ArrayList<AlertData>();
		MapPack m = (MapPack) p;
		ListValue titleLv = m.getList("title");
		ListValue levelLv = m.getList("level");
		ListValue countLv = m.getList("count");
		for (int i = 0; i < titleLv.size(); i++) {
			AlertData data = new AlertData();
			data.title = titleLv.getString(i);
			data.level = (byte) levelLv.getInt(i);
			data.count = countLv.getInt(i);
			list.add(data);
		}
		ExUtil.exec(viewer.getTable(), new Runnable() {
			public void run() {
				viewer.setInput(list);
			}
		});
	}
	 
	return Status.OK_STATUS;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:35,代码来源:AlertSummaryComposite.java

示例8: redefineClasses

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@RequestHandler(RequestCmd.REDEFINE_CLASSES)
public Pack redefineClasses(Pack param) {
	final MapPack p = new MapPack();
	ListValue classLv = ((MapPack) param).getList("class");
	HashSet<String> paramSet = new HashSet<String>();
	for (int i = 0; i < classLv.size(); i++) {
		String className = classLv.getString(i);
		paramSet.add(className);
	}
	Class[] classes = JavaAgent.getInstrumentation().getAllLoadedClasses();
	ArrayList<ClassDefinition> definitionList = new ArrayList<ClassDefinition>();
	boolean allSuccess = true;
	for (int i = 0; paramSet.size() > 0 && i < classes.length; i++) {
		if (paramSet.contains(classes[i].getName())) {
			try {
				byte[] buff = ClassUtil.getByteCode(classes[i]);
				if (buff == null) {
					continue;
				}
				definitionList.add(new ClassDefinition(classes[i], buff));
				paramSet.remove(classes[i].getName());
			} catch (Exception e) {
				p.put("success", new BooleanValue(false));
				p.put("error", e.toString());
				allSuccess = false;
				break;
			}
		}
	}
	if (definitionList.size() > 0 && allSuccess) {
		try {
			JavaAgent.getInstrumentation().redefineClasses(definitionList.toArray(new ClassDefinition[definitionList.size()]));
			p.put("success", new BooleanValue(true));
		} catch (Throwable th) {
			p.put("success", new BooleanValue(false));
			p.put("error", th.toString());
		}
	}
	return p;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:41,代码来源:AgentConfigure.java

示例9: loadObjectList

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
private ArrayList<ObjectPack> loadObjectList(String date) {
	ArrayList<ObjectPack> objList = new ArrayList<ObjectPack>();
	TcpProxy proxy = TcpProxy.getTcpProxy(serverId);
	try {
		MapPack param = new MapPack();
		param.put("date", date);
		MapPack out = (MapPack) proxy.getSingle(RequestCmd.OBJECT_LIST_LOAD_DATE, param);
		ListValue objTypeLv = out.getList("objType");
		ListValue objHashLv = out.getList("objHash");
		ListValue objNameLv = out.getList("objName");
		
		if (objHashLv == null || objHashLv.size() < 0) {
			return objList;
		}
		for (int i = 0; i < objHashLv.size(); i++) {
			ObjectPack pack = new ObjectPack();
			pack.objType = objTypeLv.getString(i);
			if (pack.objType.equals(objType) == false) {
				continue;
			}
			pack.objHash = (int) objHashLv.getLong(i);
			pack.objName = objNameLv.getString(i);
			objList.add(pack);
		}
		Collections.sort(objList, new Comparator<Pack>() {
			public int compare(Pack o1, Pack o2) {
				ObjectPack m1 = (ObjectPack) o1;
				ObjectPack m2 = (ObjectPack) o2;
				int c = m1.objType.compareTo(m2.objType);
				if (c != 0)
					return c;
				if (m1.objName != null)
					return m1.objName.compareTo(m2.objName);
				else
					return m1.objHash - m2.objHash;
			}
		});
	} finally {
		TcpProxy.putTcpProxy(proxy);
	}
	return objList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:43,代码来源:XLogSearchDialog.java

示例10: ofPackList

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
public static List<SActiveService> ofPackList(List<Pack> activeServicePackList) {
	List<SActiveService> resultList = new ArrayList<>();

	for (Pack pack : activeServicePackList) {
		MapPack mapPack = (MapPack) pack;
		int objHash = mapPack.getInt("objHash");
		String objName = AgentModelThread.getInstance().getAgentObject(objHash).getObjName();

		ListValue idLv = mapPack.getList("id");
		ListValue nameLv = mapPack.getList("name");
		ListValue statLv = mapPack.getList("stat");
		ListValue cpuLv = mapPack.getList("cpu");
		ListValue txidLv = mapPack.getList("txid");
		ListValue elapsedLv = mapPack.getList("elapsed");
		ListValue serviceLv = mapPack.getList("service");
		ListValue ipLv = mapPack.getList("ip");
		ListValue sqlLv = mapPack.getList("sql");
		ListValue subcallLv = mapPack.getList("subcall");

		if (idLv != null) {
			int size = idLv.size();

			for (int i = 0; i < size; i++) {
				SActiveService activeService = new SActiveService();
				activeService.objHash = objHash;
				activeService.objName = objName;
				activeService.threadId = idLv.getLong(i);
				activeService.threadName = nameLv.getString(i);
				activeService.threadStatus = statLv.getString(i);
				activeService.threadCpuTime = cpuLv.getLong(i);
				activeService.txidName = txidLv.getString(i);
				activeService.elapsed = elapsedLv.getLong(i);
				activeService.serviceName = serviceLv.getString(i);
				String sql = sqlLv.getString(i);
				String api = subcallLv.getString(i);
				if (StringUtil.isNotEmpty(sql)) {
					activeService.note = sql;
					activeService.mode = ActiveServiceMode.SQL.name();
				} else if (StringUtil.isNotEmpty(api)) {
					activeService.note = api;
					activeService.mode = ActiveServiceMode.SUBCALL.name();
				}
				if (ipLv != null) {
					activeService.ipaddr = ipLv.getString(i);
				}

				resultList.add(activeService);
			}
		}
		resultList.sort((s1, s2) -> s1.elapsed > s2.elapsed ? -1 : 1);
	}

	return resultList;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:55,代码来源:SActiveService.java

示例11: redefineClasses

import scouter.lang.value.ListValue; //导入方法依赖的package包/类
@RequestHandler(RequestCmd.REDEFINE_CLASSES)
public Pack redefineClasses(Pack param) {
	final MapPack p = new MapPack();
	ListValue classLv = ((MapPack) param).getList("class");
	HashSet<String> paramSet = new HashSet<String>();
	for (int i = 0; i < classLv.size(); i++) {
		String className = classLv.getString(i);
		paramSet.add(className);
	}
	Class[] classes = JavaAgent.getInstrumentation().getAllLoadedClasses();

	ArrayList<ClassDefinition> definitionList = new ArrayList<ClassDefinition>();

	boolean allSuccess = true;
	for (int i = 0; paramSet.size() > 0 && i < classes.length; i++) {
		if (paramSet.contains(classes[i].getName())) {
			try {
				byte[] buff = ClassUtil.getByteCode(classes[i]);
				if (buff == null) {
					continue;
				}
				definitionList.add(new ClassDefinition(classes[i], buff));
				paramSet.remove(classes[i].getName());
			} catch (Exception e) {
				p.put("success", new BooleanValue(false));
				p.put("error", e.toString());
				allSuccess = false;
				break;
			}
		}
	}
	if (definitionList.size() > 0 && allSuccess) {
		try {
			JavaAgent.getInstrumentation().redefineClasses(definitionList.toArray(new ClassDefinition[definitionList.size()]));
			p.put("success", new BooleanValue(true));
		} catch (Throwable th) {
			p.put("success", new BooleanValue(false));
			p.put("error", th.toString());
		}
	}
	return p;
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:43,代码来源:AgentConfigure.java


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