KickJava   Java API By Example, From Geeks To Geeks.

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


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.util.Date JavaDoc;
12 import java.util.SortedMap JavaDoc;
13
14 /**
15  * Management interface to be implemented by recorder MBeans.
16  * RecorderMBeans store a value and also keep statistics about the given value.
17  * Different implementations can determine how to acquire and calculate the value.
18  * <p/>
19  * The MBean doesn't starts automatically. It has to wait for a {@link #start} call
20  *
21  * @version $Revision: 1.4 $
22  * @see PointTime
23  */

24 public interface StatisticsRecorderMBean
25 {
26    /**
27     * Returns the Maximum Value
28     */

29    public Number JavaDoc getMax();
30
31    /**
32     * Returns the Average Value
33     */

34    public Number JavaDoc getAverage();
35
36    /**
37     * Returns the Minimum Value
38     */

39    public Number JavaDoc getMin();
40
41    /**
42     * Returns how many entries may be recorded. When the maximum amount is
43     * reached the default behaviour is to forget the oldest one
44     */

45    public int getMaxEntries();
46
47    /**
48     * Sets the maximum entries stored in this recorder
49     */

50    public void setMaxEntries(int maxEntries);
51
52    /**
53     * Returns the date when it started recording
54     */

55    public Date JavaDoc getRecordingStart();
56
57    /**
58     * Returs a sorted map of the recorded values indexed by PointTime
59     */

60    public SortedMap JavaDoc getEntries();
61
62    /**
63     * Indicates whether the MBean is recording values
64     */

65    public boolean isActive();
66
67    /**
68     * Starts recording a variable
69     */

70    public void start();
71
72    /**
73     * Stops recording a variable
74     */

75    public void stop();
76 }
77
Popular Tags