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


Java JmxAttributeMethod类代码示例

本文整理汇总了Java中com.j256.simplejmx.common.JmxAttributeMethod的典型用法代码示例。如果您正苦于以下问题:Java JmxAttributeMethod类的具体用法?Java JmxAttributeMethod怎么用?Java JmxAttributeMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getComponent

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "get Component")
public String getComponent() {
    String value = "";
    try {
        value = GameComponentsLookup.componentNames()[indexComponent] + " : ";
        if (entitas.allContexts()[context].getEntities()[indexEntity].hasComponent(indexComponent)) {
            value += gson.toJson(entitas.allContexts()[context].getEntities()[indexEntity].getComponent(indexComponent));
        } else {
            value += "Nulo";
        }

    } catch (Exception ex) {
        value = ex.getMessage();
        System.out.println(ex.getMessage());
    }
    //return  gson.toJson(entitas.game.getEntities()[indexEntity].getComponent(indexComponent));
    return value;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:19,代码来源:MonitorSystem.java

示例2: getComponentNames

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "get Components names")
public String[] getComponentNames() {
    IComponent[] components = entitas.allContexts()[context].getEntities()[indexEntity].getComponents();
    String[] componentNames = new String[components.length];
    for (int i = 0; i < components.length; i++) {
        componentNames[i] = components[i].getClass().getSimpleName();
    }
    return componentNames;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:10,代码来源:MonitorSystem.java

示例3: getGameComponents

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "Game Components")
public Map<String, Integer> getGameComponents() {
    Map<String, Integer> components = new TreeMap<>();
    for (int i = 0; i < GameComponentsLookup.componentNames().length; i++) {
        components.put(GameComponentsLookup.componentNames()[i], i);
    }
    return components;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:9,代码来源:MonitorSystem.java

示例4: getSensorComponents

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "Sensor Components")
public Map<String, Integer> getSensorComponents() {
    Map<String, Integer> components = new TreeMap<>();
    for (int i = 0; i < SensorComponentsLookup.componentNames().length; i++) {
        components.put(SensorComponentsLookup.componentNames()[i], i);
    }
    return components;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:9,代码来源:MonitorSystem.java

示例5: getActuatorComponents

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "Actuator Components")
public Map<String, Integer> getActuatorComponents() {
    Map<String, Integer> components = new TreeMap<>();
    for (int i = 0; i < ActuatorComponentsLookup.componentNames().length; i++) {
        components.put(ActuatorComponentsLookup.componentNames()[i], i);
    }
    return components;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:9,代码来源:MonitorSystem.java

示例6: getMetricValues

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "Metric values we are managing")
public String[] getMetricValues() {
	// update the metrics
	updateMetrics();
	List<String> values;
	synchronized (metrics) {
		values = new ArrayList<String>(metrics.size());
		for (ControlledMetric<?, ?> metric : metrics) {
			values.add(MiscUtils.metricToString(metric) + "=" + metric.getValue());
		}
	}
	return values.toArray(new String[values.size()]);
}
 
开发者ID:j256,项目名称:simplemetrics,代码行数:14,代码来源:MetricsManager.java

示例7: getLastDumpTimeMillisString

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
/**
 * Get the last time we have dumped the metrics to disk.
 */
@JmxAttributeMethod(description = "Last time the metrics were written")
public String getLastDumpTimeMillisString() {
	if (lastDumpTimeMillis == 0) {
		return "never";
	} else {
		return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss z").format(new Date(lastDumpTimeMillis));
	}
}
 
开发者ID:j256,项目名称:simplemetrics,代码行数:12,代码来源:TextFileMetricsPersister.java

示例8: getMetricsValues

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
/**
 * Get the values for all of the metric managed by this class.
 */
@JmxAttributeMethod(description = "Values of configured file metrics")
public String[] getMetricsValues() {
	List<String> results = new ArrayList<String>();
	for (FileMetric fileMetric : fileMetrics) {
		results.add(fileMetric.getMetric().toString() + " = " + fileMetric.getMetric().getValue());
	}
	return results.toArray(new String[results.size()]);
}
 
开发者ID:j256,项目名称:simplemetrics,代码行数:12,代码来源:FileMetricsPublisher.java

示例9: discoverAttributeMethods

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
private void discoverAttributeMethods(Map<String, JmxAttributeMethodInfo> attributeMethodInfoMap,
		Set<String> attributeNameSet, List<MBeanAttributeInfo> attributes, boolean ignoreErrors, Class<?> clazz) {
	for (Method method : clazz.getMethods()) {
		JmxAttributeMethod jmxAttribute = method.getAnnotation(JmxAttributeMethod.class);
		JmxAttributeMethodInfo attributeMethodInfo = null;
		if (jmxAttribute == null) {
			// skip it if no annotation
			if (attributeMethodInfoMap != null) {
				// was this attribute method already configured?
				attributeMethodInfo = attributeMethodInfoMap.get(method.getName());
			}
			if (attributeMethodInfo == null) {
				continue;
			}
		} else {
			attributeMethodInfo = new JmxAttributeMethodInfo(method.getName(), jmxAttribute);
			jmxAttribute = null;
		}

		try {
			discoverAttributeMethod(attributeNameSet, method, attributeMethodInfo);
		} catch (IllegalArgumentException iae) {
			if (!ignoreErrors) {
				throw iae;
			}
		}
	}
}
 
开发者ID:j256,项目名称:simplejmx,代码行数:29,代码来源:ReflectionMbean.java

示例10: getRunTime

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "The time we have been running in seconds or milliseconds")
public long getRunTime() {
	long diffMillis = System.currentTimeMillis() - startMillis;
	if (showSeconds) {
		return diffMillis / 1000;
	} else {
		return diffMillis;
	}
}
 
开发者ID:j256,项目名称:simplejmx,代码行数:10,代码来源:WebServerExample.java

示例11: getRunTime

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "Run time in seconds or milliseconds")
public long getRunTime() {
	// show how long we are running
	long diffMillis = System.currentTimeMillis() - startMillis;
	if (showSeconds) {
		// as seconds
		return diffMillis / 1000;
	} else {
		// or as milliseconds
		return diffMillis;
	}
}
 
开发者ID:j256,项目名称:simplejmx,代码行数:13,代码来源:BasicExample.java

示例12: getComponentIndices

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "get Components indices")
public int[] getComponentIndices() {
    return entitas.allContexts()[context].getEntities()[indexEntity].getComponentIndices();
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:5,代码来源:MonitorSystem.java

示例13: getGameComponentLookup

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "get Game Components Lookup")
public String getGameComponentLookup() {
    return gson.toJson(new GameComponentsLookup());
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:5,代码来源:MonitorSystem.java

示例14: getEntity

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "get Entity")
public Entity getEntity() {
    return entitas.allContexts()[context].getEntities()[indexEntity];
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:5,代码来源:MonitorSystem.java

示例15: getPersistCount

import com.j256.simplejmx.common.JmxAttributeMethod; //导入依赖的package包/类
@JmxAttributeMethod(description = "Number of times we have persisted the metrics")
public int getPersistCount() {
	return persistCount;
}
 
开发者ID:j256,项目名称:simplemetrics,代码行数:5,代码来源:MetricsManager.java


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