KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > monitor > MonitorMBean


1 /*
2  * @(#)MonitorMBean.java 4.23 04/05/18
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management.monitor;
9
10 // jmx imports
11
//
12
import javax.management.ObjectName JavaDoc;
13
14 /**
15  * Exposes the remote management interface of monitor MBeans.
16  *
17  * @version 4.23 05/18/04
18  * @author Sun Microsystems, Inc
19  *
20  * @since 1.5
21  */

22 public interface MonitorMBean {
23     
24     /**
25      * Starts the monitor.
26      */

27     public void start();
28     
29     /**
30      * Stops the monitor.
31      */

32     public void stop();
33     
34     // GETTERS AND SETTERS
35
//--------------------
36

37     /**
38      * Adds the specified object in the set of observed MBeans.
39      *
40      * @param object The object to observe.
41      * @exception java.lang.IllegalArgumentException the specified object is null.
42      *
43      * @since.unbundled JMX 1.2
44      */

45     public void addObservedObject(ObjectName JavaDoc object) throws java.lang.IllegalArgumentException JavaDoc;
46     
47     /**
48      * Removes the specified object from the set of observed MBeans.
49      *
50      * @param object The object to remove.
51      *
52      * @since.unbundled JMX 1.2
53      */

54     public void removeObservedObject(ObjectName JavaDoc object);
55     
56     /**
57      * Tests whether the specified object is in the set of observed MBeans.
58      *
59      * @param object The object to check.
60      * @return <CODE>true</CODE> if the specified object is in the set, <CODE>false</CODE> otherwise.
61      *
62      * @since.unbundled JMX 1.2
63      */

64     public boolean containsObservedObject(ObjectName JavaDoc object);
65     
66     /**
67      * Returns an array containing the objects being observed.
68      *
69      * @return The objects being observed.
70      *
71      * @since.unbundled JMX 1.2
72      */

73     public ObjectName JavaDoc[] getObservedObjects();
74     
75     /**
76      * Gets the object name of the object being observed.
77      *
78      * @return The object being observed.
79      *
80      * @see #setObservedObject
81      *
82      * @deprecated As of JMX 1.2, replaced by {@link #getObservedObjects}
83      */

84     @Deprecated JavaDoc
85     public ObjectName JavaDoc getObservedObject();
86     
87     /**
88      * Sets the object to observe identified by its object name.
89      *
90      * @param object The object to observe.
91      *
92      * @see #getObservedObject
93      *
94      * @deprecated As of JMX 1.2, replaced by {@link #addObservedObject}
95      */

96     @Deprecated JavaDoc
97     public void setObservedObject(ObjectName JavaDoc object);
98     
99     /**
100      * Gets the attribute being observed.
101      *
102      * @return The attribute being observed.
103      *
104      * @see #setObservedAttribute
105      */

106     public String JavaDoc getObservedAttribute();
107     
108     /**
109      * Sets the attribute to observe.
110      *
111      * @param attribute The attribute to observe.
112      *
113      * @see #getObservedAttribute
114      */

115     public void setObservedAttribute(String JavaDoc attribute);
116         
117     /**
118      * Gets the granularity period (in milliseconds).
119      *
120      * @return The granularity period.
121      *
122      * @see #setGranularityPeriod
123      */

124     public long getGranularityPeriod();
125     
126     /**
127      * Sets the granularity period (in milliseconds).
128      *
129      * @param period The granularity period.
130      * @exception java.lang.IllegalArgumentException The granularity
131      * period is less than or equal to zero.
132      *
133      * @see #getGranularityPeriod
134      */

135     public void setGranularityPeriod(long period) throws java.lang.IllegalArgumentException JavaDoc;
136     
137     /**
138      * Tests if the monitor MBean is active.
139      * A monitor MBean is marked active when the {@link #start start} method is called.
140      * It becomes inactive when the {@link #stop stop} method is called.
141      *
142      * @return <CODE>true</CODE> if the monitor MBean is active, <CODE>false</CODE> otherwise.
143      */

144     public boolean isActive();
145 }
146
Popular Tags