public class

StringMonitor

extends Monitor
implements StringMonitorMBean
java.lang.Object
   ↳ javax.management.NotificationBroadcasterSupport
     ↳ javax.management.monitor.Monitor
       ↳ javax.management.monitor.StringMonitor

Class Overview

Defines a monitor MBean designed to observe the values of a string attribute.

A string monitor sends notifications as follows:

  • if the attribute value matches the string to compare value, a match notification is sent. The notify match flag must be set to true.
    Subsequent matchings of the string to compare values do not cause further notifications unless the attribute value differs from the string to compare value.
  • if the attribute value differs from the string to compare value, a differ notification is sent. The notify differ flag must be set to true.
    Subsequent differences from the string to compare value do not cause further notifications unless the attribute value matches the string to compare value.

Summary

[Expand]
Inherited Constants
From class javax.management.monitor.Monitor
[Expand]
Inherited Fields
From class javax.management.monitor.Monitor
Public Constructors
StringMonitor()
Default constructor.
Public Methods
synchronized String getDerivedGauge()
This method is deprecated. As of JMX 1.2, replaced by getDerivedGauge(ObjectName)
synchronized String getDerivedGauge(ObjectName object)
Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, or null otherwise.
synchronized long getDerivedGaugeTimeStamp(ObjectName object)
Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or 0 otherwise.
synchronized long getDerivedGaugeTimeStamp()
This method is deprecated. As of JMX 1.2, replaced by getDerivedGaugeTimeStamp(ObjectName)
MBeanNotificationInfo[] getNotificationInfo()
Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the string monitor.
synchronized boolean getNotifyDiffer()
Gets the differing notification's on/off switch value common to all observed MBeans.
synchronized boolean getNotifyMatch()
Gets the matching notification's on/off switch value common to all observed MBeans.
synchronized String getStringToCompare()
Gets the string to compare with the observed attribute common to all observed MBeans.
synchronized void setNotifyDiffer(boolean value)
Sets the differing notification's on/off switch value common to all observed MBeans.
synchronized void setNotifyMatch(boolean value)
Sets the matching notification's on/off switch value common to all observed MBeans.
synchronized void setStringToCompare(String value)
Sets the string to compare with the observed attribute common to all observed MBeans.
synchronized void start()
Starts the string monitor.
synchronized void stop()
Stops the string monitor.
[Expand]
Inherited Methods
From class javax.management.monitor.Monitor
From class javax.management.NotificationBroadcasterSupport
From class java.lang.Object
From interface javax.management.MBeanRegistration
From interface javax.management.NotificationBroadcaster
From interface javax.management.NotificationEmitter
From interface javax.management.monitor.MonitorMBean
From interface javax.management.monitor.StringMonitorMBean

Public Constructors

public StringMonitor ()

Default constructor.

Public Methods

public synchronized String getDerivedGauge ()

This method is deprecated.
As of JMX 1.2, replaced by getDerivedGauge(ObjectName)

Returns the derived gauge of the first object in the set of observed MBeans.

Returns
  • The derived gauge.

public synchronized String getDerivedGauge (ObjectName object)

Gets the derived gauge of the specified object, if this object is contained in the set of observed MBeans, or null otherwise.

Parameters
object the name of the MBean whose derived gauge is required.
Returns
  • The derived gauge of the specified object.

public synchronized long getDerivedGaugeTimeStamp (ObjectName object)

Gets the derived gauge timestamp of the specified object, if this object is contained in the set of observed MBeans, or 0 otherwise.

Parameters
object the name of the object whose derived gauge timestamp is to be returned.
Returns
  • The derived gauge timestamp of the specified object.

public synchronized long getDerivedGaugeTimeStamp ()

This method is deprecated.
As of JMX 1.2, replaced by getDerivedGaugeTimeStamp(ObjectName)

Gets the derived gauge timestamp of the first object in the set of observed MBeans.

Returns
  • The derived gauge timestamp.

public MBeanNotificationInfo[] getNotificationInfo ()

Returns a NotificationInfo object containing the name of the Java class of the notification and the notification types sent by the string monitor.

Returns
  • the array of possible notifications.

public synchronized boolean getNotifyDiffer ()

Gets the differing notification's on/off switch value common to all observed MBeans.

Returns
  • true if the string monitor notifies when differing from the string to compare, false otherwise.

public synchronized boolean getNotifyMatch ()

Gets the matching notification's on/off switch value common to all observed MBeans.

Returns
  • true if the string monitor notifies when matching the string to compare, false otherwise.

public synchronized String getStringToCompare ()

Gets the string to compare with the observed attribute common to all observed MBeans.

Returns
  • The string value.

public synchronized void setNotifyDiffer (boolean value)

Sets the differing notification's on/off switch value common to all observed MBeans.

Parameters
value The differing notification's on/off switch value.

public synchronized void setNotifyMatch (boolean value)

Sets the matching notification's on/off switch value common to all observed MBeans.

Parameters
value The matching notification's on/off switch value.
See Also

public synchronized void setStringToCompare (String value)

Sets the string to compare with the observed attribute common to all observed MBeans.

Parameters
value The string value.
Throws
IllegalArgumentException The specified string to compare is null.

public synchronized void start ()

Starts the string monitor.

public synchronized void stop ()

Stops the string monitor.