本文整理汇总了Java中scouter.lang.value.ListValue类的典型用法代码示例。如果您正苦于以下问题:Java ListValue类的具体用法?Java ListValue怎么用?Java ListValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListValue类属于scouter.lang.value包,在下文中一共展示了ListValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyValueInfo
import scouter.lang.value.ListValue; //导入依赖的package包/类
public MapValue getKeyValueInfo() {
StringKeyLinkedMap<Object> defMap = ConfigValueUtil.getConfigDefault(new Configure(true));
StringKeyLinkedMap<Object> curMap = ConfigValueUtil.getConfigDefault(this);
MapValue m = new MapValue();
ListValue nameList = m.newList("key");
ListValue valueList = m.newList("value");
ListValue defList = m.newList("default");
StringEnumer enu = defMap.keys();
while (enu.hasMoreElements()) {
String key = enu.nextString();
if (ignoreSet.contains(key))
continue;
nameList.add(key);
valueList.add(ConfigValueUtil.toValue(curMap.get(key)));
defList.add(ConfigValueUtil.toValue(defMap.get(key)));
}
return m;
}
示例2: listDbFiles
import scouter.lang.value.ListValue; //导入依赖的package包/类
@ServiceHandler(RequestCmd.SERVER_DB_LIST)
public void listDbFiles(DataInputX din, DataOutputX dout, boolean login) throws IOException {
String rootPath = DBCtr.getRootPath();
MapPack m = new MapPack();
ListValue nameLv = m.newList("name");
ListValue sizeLv = m.newList("size");
ListValue lastModifiedLv = m.newList("lastModified");
File dbDir = new File(rootPath);
long totalLength = 0;
if (dbDir.exists() && dbDir.isDirectory()) {
totalLength = collectDirectory(dbDir, nameLv, sizeLv, lastModifiedLv, dbDir.getAbsolutePath());
}
if (SystemUtil.IS_JAVA_1_5 == false) {
m.put("free", dbDir.getUsableSpace());
}
m.put("total", totalLength);
dout.writeByte(TcpFlag.HasNEXT);
dout.writePack(m);
dout.flush();
}
示例3: 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();
}
示例4: collectDirectory
import scouter.lang.value.ListValue; //导入依赖的package包/类
private long collectDirectory(File dir, ListValue nameLv, ListValue sizeLv, ListValue lastModifiedLv,
String rootPath) {
long length = 0;
for (File file : dir.listFiles()) {
if (file.isFile()) {
length += file.length();
} else {
long size = collectDirectory(file, nameLv, sizeLv, lastModifiedLv, rootPath);
nameLv.add(file.getAbsolutePath().substring(rootPath.length()));
lastModifiedLv.add(file.lastModified());
sizeLv.add(size);
length += size;
}
}
return length;
}
示例5: 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);
}
}
示例6: processElapsedData
import scouter.lang.value.ListValue; //导入依赖的package包/类
private void processElapsedData(final MapPack m) {
final ListValue nameLv = m.getList("name");
final ListValue elapsedLv = m.getList("elapsed");
ExUtil.exec(canvas, new Runnable() {
public void run() {
setTitleImage(Images.active);
long now = m.getLong("time");
long stime = now - DateUtil.MILLIS_PER_FIVE_MINUTE;
xyGraph.primaryXAxis.setRange(stime, now + 1);
for (int i = 0; i < nameLv.size(); i++) {
String name = nameLv.getString(i);
double value = CastUtil.cdouble(elapsedLv.get(i));
CircularBufferDataProvider provider = (CircularBufferDataProvider) getTrace(name).getDataProvider();
provider.addSample(new Sample(now, value));
}
xyGraph.primaryYAxis.setRange(0, getMaxValue());
}
});
}
示例7: 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);
}
}
示例8: reload
import scouter.lang.value.ListValue; //导入依赖的package包/类
public void reload() {
if (table == null)
return;
table.removeAll();
MapPack mpack = getThreadList();
ListValue idLv = mpack.getList("id");
ListValue nameLv = mpack.getList("name");
ListValue statLv = mpack.getList("stat");
ListValue cpuLv = mpack.getList("cpu");
int rows = idLv == null ? 0 : idLv.size();
for (int i = 0; i < rows; i++) {
TableItem t = new TableItem(table, SWT.NONE, i);
t.setText(new String[] { //
//
FormatUtil.print(idLv.get(i), "000"), //
CastUtil.cString(nameLv.get(i)),//
CastUtil.cString(statLv.get(i)),//
FormatUtil.print(cpuLv.get(i), "#,##0"),//
});
}
sortTable();
}
示例9: getThreadList
import scouter.lang.value.ListValue; //导入依赖的package包/类
public static MapPack getThreadList() {
ThreadMXBean tmb = ManagementFactory.getThreadMXBean();
long[] thread = tmb.getAllThreadIds();
MapPack pack = new MapPack();
ListValue id = pack.newList("id");
ListValue name = pack.newList("name");
ListValue stat = pack.newList("stat");
ListValue cpu = pack.newList("cpu");
for (int i = 0; i < thread.length; i++) {
ThreadInfo fo = tmb.getThreadInfo(thread[i]);
id.add(fo.getThreadId());
name.add(fo.getThreadName());
stat.add(fo.getThreadState().toString());
cpu.add(tmb.getThreadCpuTime(thread[i]) / 1000000);
}
return pack;
}
示例10: run
import scouter.lang.value.ListValue; //导入依赖的package包/类
protected IStatus run(IProgressMonitor monitor) {
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
monitor.beginTask("Delete Server Files.....", IProgressMonitor.UNKNOWN);
MapPack param = new MapPack();
ListValue fileLv = param.newList("file");
for (int i = 0; i < elements.length; i++) {
if (elements[i] instanceof DirObject) {
DirObject obj = (DirObject) elements[i];
fileLv.add(obj.name);
}
}
MapPack m = (MapPack) tcp.getSingle(RequestCmd.SERVER_DB_DELETE, param);
monitor.done();
int size = m.getInt("size");
ConsoleProxy.infoSafe(size + " directories is deleted.");
load();
} catch (Exception e) {
e.printStackTrace();
} finally {
TcpProxy.putTcpProxy(tcp);
}
return Status.OK_STATUS;
}
示例11: reload
import scouter.lang.value.ListValue; //导入依赖的package包/类
public void reload() {
if (table == null)
return;
table.removeAll();
MapPack mpack = ServerDataProxy.getThreadList(serverId);
ListValue idLv = mpack.getList("id");
ListValue nameLv = mpack.getList("name");
ListValue statLv = mpack.getList("stat");
ListValue cpuLv = mpack.getList("cpu");
int rows = idLv == null ? 0 : idLv.size();
for (int i = 0; i < rows; i++) {
TableItem t = new TableItem(table, SWT.NONE, i);
t.setText(new String[] { //
//
FormatUtil.print(idLv.get(i), "000"), //
CastUtil.cString(nameLv.get(i)),//
CastUtil.cString(statLv.get(i)),//
FormatUtil.print(cpuLv.get(i), "#,##0"),//
});
}
sortTable();
}
示例12: getObjGroups
import scouter.lang.value.ListValue; //导入依赖的package包/类
public Set<String> getObjGroups(int objHash) {
List<Value> groupList = new ArrayList<Value>();
Set<String> groups = new HashSet<String>();
Value v = objGroupMap.get(String.valueOf(objHash));
if (v != null && v instanceof ListValue) {
ListValue lv = (ListValue) v;
for (int i = 0; i < lv.size(); i++) {
TextValue groupName = (TextValue) lv.get(i);
if (groupTypeMap.containsKey(groupName.value)) {
groupList.add(groupName);
groups.add(groupName.value);
}
}
objGroupMap.put(String.valueOf(objHash), new ListValue(groupList));
}
return groups;
}
示例13: getObjectsByGroup
import scouter.lang.value.ListValue; //导入依赖的package包/类
public Set<Integer> getObjectsByGroup(String grpName) {
Set objSet = groupObjTable.get(grpName);
if (objSet != null) {
return objSet;
}
objSet = new HashSet<Integer>();
Iterator<String> keys = objGroupMap.keys();
while (keys.hasNext()) {
String objHash = keys.next();
Value v = objGroupMap.get(objHash);
if (v != null && v instanceof ListValue) {
ListValue groupLv = (ListValue) v;
for (int i = 0; i < groupLv.size(); i++) {
if (grpName.equals(groupLv.getString(i))) {
objSet.add(Integer.valueOf(objHash));
break;
}
}
}
}
groupObjTable.put(grpName, objSet);
return objSet;
}
示例14: readConsoleMessage
import scouter.lang.value.ListValue; //导入依赖的package包/类
private void readConsoleMessage(long loop, long index, boolean first) {
MapPack param = new MapPack();
param.put("loop", loop);
param.put("index", index);
ExUtil.asyncRun(() -> {
MapPack resultMapPack = getResultMapPack(RequestCmd.GET_ALERT_SCRIPT_LOAD_MESSAGE, param);
if (resultMapPack != null) {
consoleLoop = resultMapPack.getLong("loop");
consoleIndex = resultMapPack.getInt("index");
if (first) {
return;
}
ListValue messageLv = resultMapPack.getList("messages");
for (String message : messageLv.toStringArray()) {
consoleText.getDisplay().asyncExec(() -> consoleText.append(message + "\n"));
}
}
});
}
示例15: requestRedefineClass
import scouter.lang.value.ListValue; //导入依赖的package包/类
private void requestRedefineClass(ArrayList<String> classes, int serverId){
TcpProxy tcp = TcpProxy.getTcpProxy(serverId);
try {
MapPack param = new MapPack();
param.put("objHash", this.objHash);
ListValue classNames = param.newList("classNames");
for(int inx = 0 ; inx < classes.size() ; inx++){
classNames.add(classes.get(inx));
}
@SuppressWarnings("unused")
MapPack out = (MapPack) tcp.getSingle(RequestCmd.REDEFINE_CLASSES, param);
} catch(Exception e){
ConsoleProxy.errorSafe(e.toString());
} finally {
TcpProxy.putTcpProxy(tcp);
}
}