01: package com.sun.portal.rproxy.monitoring.statistics;
02:
03: import com.sun.portal.monitoring.statistics.StatisticWrapper;
04:
05: import javax.management.openmbean.OpenType;
06: import javax.management.openmbean.SimpleType;
07:
08: /**
09: * author: Noble Paul
10: * Date: Mar 4, 2005, 11:23:13 AM
11: */
12: public class ThreadActivityStatisticWrapper extends StatisticWrapper {
13: public static final String THREAD_NAME = "ThreadName";
14:
15: public static final String TASK_TYPE = "TaskType";
16:
17: public static final String START_TIME = "TaskStartTime";
18:
19: public static final String DESTINATION = "Destination";
20:
21: public String getCompositeTypeName() {
22: return getClass().getName();
23: }
24:
25: public String[] getItemNames() {
26: return new String[] { THREAD_NAME, TASK_TYPE, START_TIME,
27: DESTINATION, "Description", "LastSampleTime", "Name",
28: "StartTime", "Unit" };
29: }
30:
31: public String[] getItemDescriptions() {
32: return getItemNames();
33: }
34:
35: public OpenType[] getItemTypes() {
36: return new OpenType[] {
37: SimpleType.STRING, //ThreadName
38: SimpleType.STRING, //TaskType
39: SimpleType.LONG, //Start time
40: SimpleType.STRING, //destiination
41: SimpleType.STRING, SimpleType.LONG, SimpleType.STRING,
42: SimpleType.LONG, SimpleType.STRING };
43: }
44:
45: public Object[] getItemValues() {
46: ThreadActivityStatisticImpl tasi = (ThreadActivityStatisticImpl) getStatisticImpl();
47: return new Object[] { tasi.getThreadName(), tasi.getTaskType(),
48: new Long(tasi.getTaskStartTime()),
49: tasi.getDestination(), tasi.getDescription(),
50: new Long(tasi.getLastSampleTime()), tasi.getName(),
51: new Long(tasi.getStartTime()), tasi.getUnit() };
52:
53: }
54:
55: }
|