createMonitoredObject(name,
MonitoringConstants.THREADPOOL_MONITORING_DESCRIPTION);
threadPoolMonitoringObjectRoot.addChild(threadpoolMonitoredObject);
LongMonitoredAttributeBase b1 = new
LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS,
MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
public Object getValue() {
return new Long(ThreadPoolImpl.this.currentNumberOfThreads());
}
};
threadpoolMonitoredObject.addAttribute(b1);
LongMonitoredAttributeBase b2 = new
LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_AVAILABLE_THREADS,
MonitoringConstants.THREADPOOL_CURRENT_NUMBER_OF_THREADS_DESCRIPTION) {
public Object getValue() {
return new Long(ThreadPoolImpl.this.numberOfAvailableThreads());
}
};
threadpoolMonitoredObject.addAttribute(b2);
LongMonitoredAttributeBase b3 = new
LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS,
MonitoringConstants.THREADPOOL_NUMBER_OF_BUSY_THREADS_DESCRIPTION) {
public Object getValue() {
return new Long(ThreadPoolImpl.this.numberOfBusyThreads());
}
};
threadpoolMonitoredObject.addAttribute(b3);
LongMonitoredAttributeBase b4 = new
LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME,
MonitoringConstants.THREADPOOL_AVERAGE_WORK_COMPLETION_TIME_DESCRIPTION) {
public Object getValue() {
return new Long(ThreadPoolImpl.this.averageWorkCompletionTime());
}
};
threadpoolMonitoredObject.addAttribute(b4);
LongMonitoredAttributeBase b5 = new
LongMonitoredAttributeBase(MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT,
MonitoringConstants.THREADPOOL_CURRENT_PROCESSED_COUNT_DESCRIPTION) {
public Object getValue() {
return new Long(ThreadPoolImpl.this.currentProcessedCount());
}