001: /* JFox, the OpenSource J2EE Application Server
002: *
003: * Copyright (C) 2002 huihoo.org
004: * Distributable under GNU LGPL license
005: * See the GNU Lesser General Public License for more details.
006: */
007:
008: package javax.management.monitor;
009:
010: import javax.management.ObjectName;
011:
012: /**
013: * Exposes the remote management interface of monitor MBeans.
014: *
015: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
016: */
017:
018: public interface MonitorMBean {
019:
020: /**
021: * Adds the specified object in the set of observed MBeans.
022: *
023: * @param object The object to observe.
024: * @exception java.lang.IllegalArgumentException the specified object is null.
025: *
026: * @since JMX 1.2
027: */
028: public void addObservedObject(ObjectName object)
029: throws java.lang.IllegalArgumentException;
030:
031: /**
032: * Removes the specified object from the set of observed MBeans.
033: *
034: * @param object The object to remove.
035: *
036: * @since JMX 1.2
037: */
038: public void removeObservedObject(ObjectName object);
039:
040: /**
041: * Tests whether the specified object is in the set of observed MBeans.
042: *
043: * @param object The object to check.
044: * @return <CODE>true</CODE> if the specified object is in the set, <CODE>false</CODE> otherwise.
045: *
046: * @since JMX 1.2
047: */
048: public boolean containsObservedObject(ObjectName object);
049:
050: /**
051: * Returns an array containing the objects being observed.
052: *
053: * @return The objects being observed.
054: *
055: * @since JMX 1.2
056: */
057: public ObjectName[] getObservedObjects();
058:
059: /**
060: * Gets the attribute being observed.
061: *
062: * @return The attribute being observed.
063: *
064: * @see #setObservedAttribute
065: */
066: public String getObservedAttribute();
067:
068: /**
069: * Sets the attribute to observe.
070: *
071: * @param attribute The attribute to observe.
072: *
073: * @see #getObservedAttribute
074: */
075: public void setObservedAttribute(String attribute);
076:
077: /**
078: * Gets the granularity period (in milliseconds).
079: *
080: * @return The granularity period.
081: *
082: * @see #setGranularityPeriod
083: */
084: public long getGranularityPeriod();
085:
086: /**
087: * Sets the granularity period (in milliseconds).
088: *
089: * @param period The granularity period.
090: * @exception java.lang.IllegalArgumentException The granularity
091: * period is less than or equal to zero.
092: *
093: * @see #getGranularityPeriod
094: */
095: public void setGranularityPeriod(long period)
096: throws java.lang.IllegalArgumentException;
097:
098: /**
099: * Tests if the monitor MBean is active.
100: * A monitor MBean is marked active when the doStart() method is called.
101: * It becomes inactive when the doStart() method is called.
102: *
103: * @return <CODE>true</CODE> if the monitor MBean is active, <CODE>false</CODE> otherwise.
104: */
105: public boolean isActive();
106: }
|