本文整理匯總了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;
}