本文整理汇总了Java中org.springframework.jmx.export.annotation.ManagedAttribute类的典型用法代码示例。如果您正苦于以下问题:Java ManagedAttribute类的具体用法?Java ManagedAttribute怎么用?Java ManagedAttribute使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ManagedAttribute类属于org.springframework.jmx.export.annotation包,在下文中一共展示了ManagedAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRegisteredServicesAsStrings
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
/**
* Gets the registered services as strings.
*
* @return the registered services as strings
*/
@ManagedAttribute(description = "Retrieves the list of Registered Services in a slightly friendlier output.")
public final List<String> getRegisteredServicesAsStrings() {
final List<String> services = new ArrayList<>();
for (final RegisteredService r : this.servicesManager.getAllServices()) {
services.add(new StringBuilder().append("id: ").append(r.getId())
.append(" name: ").append(r.getName())
.append(" serviceId: ").append(r.getServiceId())
.toString());
}
return services;
}
示例2: getApiRequestsSummary
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description = "The total number of requests sent of each supported Interface command")
public Map<String, Long> getApiRequestsSummary() {
return apiInterface.getRequestsSummary().entrySet()
.stream()
.collect(
Collectors.toMap( me -> me.getKey().toString(),
me -> me.getValue())
);
}
示例3: getRegisteredServicesAsStrings
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description = "Retrieves the list of Registered Services in a slightly friendlier output.")
public final List<String> getRegisteredServicesAsStrings() {
final List<String> services = new ArrayList<String>();
for (final RegisteredService r : this.servicesManager.getAllServices()) {
services.add(new StringBuilder().append("id: ").append(r.getId())
.append(" name: ").append(r.getName())
.append(" enabled: ").append(r.isEnabled())
.append(" ssoEnabled: ").append(r.isSsoEnabled())
.append(" serviceId: ").append(r.getServiceId())
.toString());
}
return services;
}
示例4: getCallTime
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute
public long getCallTime() {
if (this.callCount > 0) {
return this.accumulatedCallTime / this.callCount;
} else {
return 0;
}
}
示例5: getDataSourceImpl
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute
public String getDataSourceImpl() {
if (this.entityManagerFactory == null || this.entityManagerFactory.getDataSource() == null) {
return "";
}
return this.entityManagerFactory.getDataSource().getClass().getName();
}
示例6: setPurgeFlowsOlderThan
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description="Purge flows older than given duration "
+ "(e.g. \"30d\" will purge flows older than 30 days)")
public void setPurgeFlowsOlderThan(String purgeFlowsOlderThan) {
ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application);
String s = formatInput(purgeFlowsOlderThan);
if (s != null) {
applicationConfig.setPurgeFlowsOlderThan(s);
flowManager.mergeApplicationConfig(applicationConfig);
}
}
示例7: setDoNotPurgeErrorFlows
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description="Set to true to exclude ERROR flows from being purged. "
+ "Set to false to purge CLEAN and ERROR flows")
public void setDoNotPurgeErrorFlows(boolean doNotPurgeErrorFlows) {
ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application);
applicationConfig.setDoNotPurgeErrorFlows(doNotPurgeErrorFlows);
flowManager.mergeApplicationConfig(applicationConfig);
}
示例8: getSchedulerMetaData
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description="Schedulers metadata")
public Map<String, String> getSchedulerMetaData() {
Map<String, String> map = new HashMap<>();
try {
map.put("Scheduler Name", scheduler.getMetaData().getSchedulerName());
map.put("Scheduler Class", scheduler.getMetaData().getSchedulerClass().getCanonicalName());
map.put("Thread Pool Class", scheduler.getMetaData().getThreadPoolClass().getCanonicalName());
map.put("Thread Pool Size", String.valueOf(scheduler.getMetaData().getThreadPoolSize()));
map.put("Number Of Jobs Executed", String.valueOf(scheduler.getMetaData().getNumberOfJobsExecuted()));
map.put("Running Since", MBeanUtils.formatDate(scheduler.getMetaData().getRunningSince()));
return map;
} catch (SchedulerException e) {
return null;
}
}
示例9: getUpperTimeLimit
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description="Upper time limit")
public String getUpperTimeLimit() {
if (upperTimeLimit == null) {
return null;
}
return formatDate(upperTimeLimit);
}
示例10: setUpperTimeLimit
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description="Upper time limit")
public void setUpperTimeLimit(String upperTimeLimit) throws ParseException {
if (upperTimeLimit == null || upperTimeLimit.trim().equals("")) {
this.upperTimeLimit = null;
} else {
this.upperTimeLimit = parseDate(upperTimeLimit);
}
}
示例11: getMaxFlows
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description =
"Maximum number of flows returned by finder operations or processed during replay operations")
public String getMaxFlows() {
if (maxResults == null) {
return null;
}
return maxResults.toString();
}
示例12: setMaxFlows
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute(description =
"Maximum number of flows returned by finder operations or processed during replay operations")
public void setMaxFlows(String maxFlows) {
if (maxFlows == null || maxFlows.trim().equals("")) {
maxResults = null;
} else {
maxResults = Integer.valueOf(maxFlows);
}
}
示例13: getHealth
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute
public Map getHealth()
{
Health health = healthEndpoint.invoke();
Map healthMap = new LinkedHashMap();
healthMap.put("status", getStatus(health));
healthMap.put("detail", getDetails(health.getDetails()));
return healthMap;
}
示例14: getCallTime
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
@ManagedAttribute
public long getCallTime() {
if (this.callCount > 0)
return this.accumulatedCallTime / this.callCount;
else
return 0;
}
示例15: getObjectName
import org.springframework.jmx.export.annotation.ManagedAttribute; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see org.springframework.jmx.export.naming.SelfNaming#getObjectName()
*/
@Override
@ManagedAttribute(description="This processor's JMX ObjectName")
public ObjectName getObjectName() throws MalformedObjectNameException {
objectName = JMXHelper.objectName("com.heliosapm.streams.metrics.processors:service=Processor,type=" + getClass().getSimpleName() + ",instance=" + instanceId);
return objectName;
}