KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > tools > stats > StatisticsRecorderMBeanDescription


1 /*
2  * Copyright (C) The MX4J Contributors.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.tools.stats;
10
11 import java.lang.reflect.Method JavaDoc;
12
13 import mx4j.MBeanDescriptionAdapter;
14
15 /**
16  * Descriptions of the {@link StatisticsRecorderMBean} interface
17  *
18  * @version $Revision: 1.4 $
19  * @see PointTime
20  */

21 public class StatisticsRecorderMBeanDescription extends MBeanDescriptionAdapter
22 {
23    public String JavaDoc getAttributeDescription(String JavaDoc attribute)
24    {
25       if (attribute.equals("Max"))
26       {
27          return "Maximum observed value";
28       }
29       if (attribute.equals("Min"))
30       {
31          return "Minimum observed value";
32       }
33       if (attribute.equals("Average"))
34       {
35          return "Average of the observed values";
36       }
37       if (attribute.equals("MaxEntries"))
38       {
39          return "Amount of values stored in memory";
40       }
41       if (attribute.equals("RecordingStart"))
42       {
43          return "Date when the recording was inited";
44       }
45       if (attribute.equals("Entries"))
46       {
47          return "SortedMap of the recorded values indexed by PointTime values";
48       }
49       if (attribute.equals("Active"))
50       {
51          return "Indicates whether the MBean is recording";
52       }
53       return super.getAttributeDescription(attribute);
54    }
55
56    public String JavaDoc getOperationDescription(Method JavaDoc operation)
57    {
58       if (operation.equals("start"))
59       {
60          return "Starts the recording";
61       }
62       if (operation.equals("stop"))
63       {
64          return "Stops the recording";
65       }
66       return super.getOperationDescription(operation);
67    }
68 }
69
Popular Tags