本文整理汇总了Java中scouter.util.HashUtil类的典型用法代码示例。如果您正苦于以下问题:Java HashUtil类的具体用法?Java HashUtil怎么用?Java HashUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HashUtil类属于scouter.util包,在下文中一共展示了HashUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkSettingChange
import scouter.util.HashUtil; //导入依赖的package包/类
private void checkSettingChange() {
ExUtil.exec(canvas, new Runnable() {
public void run() {
int width = PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH);
synchronized (traces) {
for (Trace t : traces.values()) {
if (selectedMode == false && t.getLineWidth() != width) {
t.setLineWidth(width);
}
int objHash = HashUtil.hash(t.getName());
AgentObject agent = AgentModelThread.getInstance().getAgentObject(objHash);
if (agent == null || agent.isAlive() == false || agent.getColor() == null) {
return;
}
if (t.getTraceColor() != agent.getColor()) {
t.setTraceColor(agent.getColor());
}
}
}
}
});
}
开发者ID:scouter-project,项目名称:scouter,代码行数:23,代码来源:CounterRealTimeGroupAllView.java
示例2: notifyChangeState
import scouter.util.HashUtil; //导入依赖的package包/类
public void notifyChangeState() {
ExUtil.asyncRun(new Runnable() {
public void run() {
for (Trace t : traces) {
String objName = t.getName();
if (ObjectSelectManager.getInstance().isUnselectedObject(HashUtil.hash(objName))) {
t.setVisible(false);
} else {
t.setVisible(true);
}
}
ExUtil.exec(canvas, new Runnable() {
public void run() {
redraw();
}
});
}
});
}
开发者ID:scouter-project,项目名称:scouter,代码行数:20,代码来源:CounterPastDateGroupAllView.java
示例3: saveConfigContents
import scouter.util.HashUtil; //导入依赖的package包/类
private SaveResult saveConfigContents() {
String contents = ruleText.getText();
if (HashUtil.hash(contents) == ruleContentsHash) {
return SaveResult.NA;
}
MapPack paramPack = new MapPack();
paramPack.put("counterName", this.counterName);
paramPack.put("contents", contents);
MapPack resultPack = getResultMapPack(RequestCmd.SAVE_ALERT_SCRIPTING_CONTETNS, paramPack);
if (resultPack == null) {
return SaveResult.FAIL;
}
if (resultPack.getBoolean("success")) {
ruleContentsHash = HashUtil.hash(contents);
return SaveResult.SUCCESS;
} else {
return SaveResult.FAIL;
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:20,代码来源:AlertScriptingView.java
示例4: saveRuleContents
import scouter.util.HashUtil; //导入依赖的package包/类
private SaveResult saveRuleContents() {
String contents = configText.getText();
if (HashUtil.hash(contents) == configContentsHash) {
return SaveResult.NA;
}
MapPack paramPack = new MapPack();
paramPack.put("counterName", this.counterName);
paramPack.put("contents", contents);
MapPack resultPack = getResultMapPack(RequestCmd.SAVE_ALERT_SCRIPTING_CONFIG_CONTETNS, paramPack);
if (resultPack == null) {
return SaveResult.FAIL;
}
if (resultPack.getBoolean("success")) {
ruleContentsHash = HashUtil.hash(contents);
return SaveResult.SUCCESS;
} else {
return SaveResult.FAIL;
}
}
开发者ID:scouter-project,项目名称:scouter,代码行数:21,代码来源:AlertScriptingView.java
示例5: checkSettingChange
import scouter.util.HashUtil; //导入依赖的package包/类
private void checkSettingChange() {
ExUtil.exec(canvas, new Runnable() {
public void run() {
int width = PManager.getInstance().getInt(PreferenceConstants.P_CHART_LINE_WIDTH);
synchronized (traces) {
for (Trace t : traces) {
if (nearestTrace == null && t.getLineWidth() != width) {
t.setLineWidth(width);
}
int objHash = HashUtil.hash(t.getName());
AgentObject agent = AgentModelThread.getInstance().getAgentObject(objHash);
if (agent == null || agent.isAlive() == false || agent.getColor() == null) {
return;
}
if (t.getTraceColor() != agent.getColor()) {
t.setTraceColor(agent.getColor());
}
}
}
}
});
}
开发者ID:scouter-project,项目名称:scouter,代码行数:23,代码来源:CounterRealTimeAllView.java
示例6: hashCode
import scouter.util.HashUtil; //导入依赖的package包/类
@Override
public int hashCode() {
int filter_hash = HashUtil.hash(objName);
filter_hash ^= HashUtil.hash(service);
filter_hash ^= HashUtil.hash(ip);
filter_hash ^= HashUtil.hash(login);
filter_hash ^= HashUtil.hash(desc);
filter_hash ^= HashUtil.hash(text1);
filter_hash ^= HashUtil.hash(text2);
filter_hash ^= HashUtil.hash(text3);
filter_hash ^= HashUtil.hash(text4);
filter_hash ^= HashUtil.hash(text5);
filter_hash ^= HashUtil.hash(userAgent);
filter_hash ^= HashUtil.hash(onlyError ? "onlyError" : "");
filter_hash ^= HashUtil.hash(onlySql ? "onlySql" : "");
filter_hash ^= HashUtil.hash(onlyApicall ? "onlyApicall" : "");
return filter_hash;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:19,代码来源:XLogFilterStatus.java
示例7: createLoader
import scouter.util.HashUtil; //导入依赖的package包/类
private synchronized static ClassLoader createLoader(ClassLoader parent, String key) {
int hashKey = (parent == null ? 0 : System.identityHashCode(parent));
hashKey = hashKey ^ HashUtil.hash(key);
ClassLoader loader = loaders.get(hashKey);
if (loader == null) {
try {
byte[] bytes = deployJarBytes(key);
if (bytes != null) {
loader = new BytesClassLoader(bytes, parent);
loaders.put(hashKey, loader);
}
} catch (Throwable e) {
Logger.println("A137", "SUBLOADER " + key + " " + e);
}
}
return loader;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:19,代码来源:LoaderManager.java
示例8: getUseridCustom
import scouter.util.HashUtil; //导入依赖的package包/类
public static long getUseridCustom(HttpServletRequest req, HttpServletResponse res, String key) {
if (key == null || key.length() == 0)
return 0;
try {
String cookie = req.getHeader("Cookie");
if (cookie != null) {
int x1 = cookie.indexOf(key);
if (x1 >= 0) {
String value = null;
int x2 = cookie.indexOf(';', x1);
if (x2 > 0) {
value = cookie.substring(x1 + key.length() + 1, x2);
} else {
value = cookie.substring(x1 + key.length() + 1);
}
if (value != null) {
return HashUtil.hash(value);
}
}
}
} catch (Throwable t) {
Logger.println("A154", t.toString());
}
return 0;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:26,代码来源:UseridUtil.java
示例9: resetObjInfo
import scouter.util.HashUtil; //导入依赖的package包/类
public synchronized void resetObjInfo() {
String detected = CounterConstants.HOST;
if (SystemUtil.IS_LINUX) {
detected = CounterConstants.LINUX;
} else if (SystemUtil.IS_WINDOWS) {
detected = CounterConstants.WINDOWS;
} else if (SystemUtil.IS_MAC_OSX) {
detected = CounterConstants.OSX;
} else if (SystemUtil.IS_AIX) {
detected = CounterConstants.AIX;
} else if (SystemUtil.IS_HP_UX) {
detected = CounterConstants.HPUX;
}
this.objDetectedType = detected;
this.monitoring_group_type = getValue("monitoring_group_type");
this.obj_type = StringUtil.isEmpty(this.monitoring_group_type) ? getValue("obj_type", detected) : this.monitoring_group_type;
this.obj_name = getValue("obj_name", SysJMX.getHostName());
this.objName = "/" + this.obj_name;
this.objHash = HashUtil.hash(objName);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:25,代码来源:Configure.java
示例10: addGroup
import scouter.util.HashUtil; //导入依赖的package包/类
public int addGroup(String groupName) {
int grpHash = HashUtil.hash(groupName);
if (saved.contains(grpHash) == false) {
TextPermWR.add(TextTypes.GROUP, grpHash, groupName);
}
return grpHash;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:IXLog.java
示例11: fileSign
import scouter.util.HashUtil; //导入依赖的package包/类
private long fileSign(File f) {
if (f == null)
return 0;
String filename = f.getName();
long filetime = f.lastModified();
return BitUtil.setHigh(filetime, HashUtil.hash(filename));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:AlertRuleLoader.java
示例12: getFloatValue
import scouter.util.HashUtil; //导入依赖的package包/类
@ConfigDesc("get the another objects counter's value as float.")
@ParamDesc("String objectFullName, String counter")
public float getFloatValue(String objectFullName, String counter) {
int anotherObjHash = HashUtil.hash(objectFullName);
Value v = CounterCache.get(new CounterKey(anotherObjHash, counter, _timetype));
if (v instanceof Number)
return ((Number) v).floatValue();
else
return 0;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:RealCounter.java
示例13: getIntValue
import scouter.util.HashUtil; //导入依赖的package包/类
@ConfigDesc("get the another objects counter's value as int.")
@ParamDesc("String objectFullName, String counter")
public int getIntValue(String objectFullName, String counter) {
int anotherObjHash = HashUtil.hash(objectFullName);
Value v = CounterCache.get(new CounterKey(anotherObjHash, counter, _timetype));
if (v instanceof Number)
return ((Number) v).intValue();
else
return 0;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:11,代码来源:RealCounter.java
示例14: extractObjectPack
import scouter.util.HashUtil; //导入依赖的package包/类
private static ObjectPack extractObjectPack(JSONObject objJson) {
String host = (String) objJson.get("host");
String name = (String) objJson.get("name");
String objName = getObjName(host, name);
int objHash = HashUtil.hash(objName);
ObjectPack objPack = new ObjectPack();
objPack.objHash = objHash;
objPack.objName = objName;
objPack.objType = (String) objJson.get("type");
objPack.address = (String) objJson.get("address");
return objPack;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:13,代码来源:CounterHandler.java
示例15: toPack
import scouter.util.HashUtil; //导入依赖的package包/类
public AlertPack toPack() {
AlertPack pack = new AlertPack();
pack.level = AlertLevel.getValue(level);
pack.message = message;
pack.objHash = object == null ? 0 : HashUtil.hash(object);
pack.objType = objType;
pack.tags = tags;
pack.time = time;
pack.title = title;
return pack;
}
开发者ID:scouter-project,项目名称:scouter,代码行数:12,代码来源:AlertDetailListView.java
示例16: getServer
import scouter.util.HashUtil; //导入依赖的package包/类
public Server getServer(String addr) {
String[] iport = addr.split(":");
if (iport == null || iport.length < 2) {
return null;
}
return getServer(HashUtil.hash(iport[0] + iport[1]));
}
开发者ID:scouter-project,项目名称:scouter,代码行数:8,代码来源:ServerManager.java
示例17: isRunningServer
import scouter.util.HashUtil; //导入依赖的package包/类
public boolean isRunningServer(String ip, String port) {
int hash = HashUtil.hash(ip + port);
Server server = serverMap.get(hash);
if (server == null) {
return false;
}
return server.isOpen();
}
开发者ID:scouter-project,项目名称:scouter,代码行数:9,代码来源:ServerManager.java
示例18: loadAlertScriptingContents
import scouter.util.HashUtil; //导入依赖的package包/类
private void loadAlertScriptingContents() {
MapPack param = new MapPack();
param.put("counterName", this.counterName);
ExUtil.asyncRun(() -> {
MapPack resultMapPack = getResultMapPack(RequestCmd.GET_ALERT_SCRIPTING_CONTETNS, param);
if (resultMapPack != null) {
String contents = StringUtil.emptyToDefault(resultMapPack.getText("contents"), DEFAULT_RULE_CONTENTS);
ruleText.getDisplay().asyncExec(() -> {
ruleText.setText(contents);
ruleContentsHash = HashUtil.hash(contents);
ruleTextUndo.clear();
});
}
});
}
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:AlertScriptingView.java
示例19: loadAlertScriptingConfigContents
import scouter.util.HashUtil; //导入依赖的package包/类
private void loadAlertScriptingConfigContents() {
MapPack param = new MapPack();
param.put("counterName", this.counterName);
ExUtil.asyncRun(() -> {
MapPack resultMapPack = getResultMapPack(RequestCmd.GET_ALERT_SCRIPTING_CONFIG_CONTETNS, param);
if (resultMapPack != null) {
String contents = StringUtil.emptyToDefault(resultMapPack.getText("contents"), DEFAULT_CONFIG_CONTENTS);
configText.getDisplay().asyncExec(() -> {
configText.setText(contents);
configContentsHash = HashUtil.hash(contents);
configTextUndo.clear();
});
}
});
}
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:AlertScriptingView.java
示例20: resetObjInfo
import scouter.util.HashUtil; //导入依赖的package包/类
public synchronized void resetObjInfo() {
this.obj_type = getValue("obj_type", CounterConstants.BATCH);
String detected = CounterConstants.HOST;
if (SystemUtil.IS_LINUX) {
detected = CounterConstants.LINUX;
} else if (SystemUtil.IS_WINDOWS) {
detected = CounterConstants.WINDOWS;
} else if (SystemUtil.IS_MAC_OSX) {
detected = CounterConstants.OSX;
} else if (SystemUtil.IS_AIX) {
detected = CounterConstants.AIX;
} else if (SystemUtil.IS_HP_UX) {
detected = CounterConstants.HPUX;
}
this.obj_host_type = getValue("obj_host_type", detected);
this.obj_host_name = getValue("obj_host_name", SysJMX.getHostName());
this.objHostName = "/" + this.obj_host_name;
this.objHostHash = HashUtil.hash(this.objHostName);
this.obj_name_auto_pid_enabled = getBoolean("obj_name_auto_pid_enabled", false);
this.obj_name = getValue("obj_name", "batch");
this.objName = this.objHostName + "/" + this.obj_name;
// make hash value
try { this.objHash = HashUtil.hash( objName.getBytes("UTF-8")); }catch(Throwable ex){}
System.setProperty("scouter.objname", this.objName);
System.setProperty("scouter.objtype", this.obj_type);
System.setProperty("scouter.dir", agent_dir_path);
}
开发者ID:scouter-project,项目名称:scouter,代码行数:30,代码来源:Configure.java
注:本文中的scouter.util.HashUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论