Top Description Inners Fields Constructors Methods
javax.management.monitor

public Class StringMonitor

extends Monitor
implements StringMonitorMBean
Class Inheritance
All Implemented Interfaces
javax.management.monitor.StringMonitorMBean, javax.management.monitor.MonitorMBean
Static Imports
com.sun.jmx.defaults.JmxProperties.MONITOR_LOGGER, javax.management.monitor.MonitorNotification.*

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

A string monitor sends notifications as follows:

Since
1.5

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final MBeanNotificationInfo[]
private boolean
notifyDiffer

Flag indicating if the string monitor notifies when differing from the string to compare.

private boolean
notifyMatch

Flag indicating if the string monitor notifies when matching the string to compare.

private String
stringToCompare

String to compare with the observed attribute.

private static final String[]
Inherited from javax.management.monitor.Monitor:
alreadyNotifiedalreadyNotifiedscapacityIncrementdbgTagelementCountINTEGER_ZEROOBSERVED_ATTRIBUTE_ERROR_NOTIFIEDOBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIEDOBSERVED_OBJECT_ERROR_NOTIFIEDobservedObjectsRESET_FLAGS_ALREADY_NOTIFIEDRUNTIME_ERROR_NOTIFIEDserverTHRESHOLD_ERROR_NOTIFIED

Constructor Summary

AccessConstructor and Description
public
StringMonitor()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
pack-priv synchronized MonitorNotification
pack-priv Monitor.ObservedObject
createObservedObject(ObjectName object)

Overrides javax.management.monitor.Monitor.createObservedObject.

Factory method for ObservedObject creation.

public synchronized String

Returns:

The derived gauge of the specified object.
getDerivedGauge
(ObjectName
the name of the MBean whose derived gauge is required.
object
)

Overrides javax.management.monitor.Monitor.getDerivedGauge.

Implements javax.management.monitor.StringMonitorMBean.getDerivedGauge.

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

public synchronized String

Returns:

The derived gauge.
getDerivedGauge
()

Implements javax.management.monitor.StringMonitorMBean.getDerivedGauge.

Deprecated As of JMX 1.2, replaced by getDerivedGauge(ObjectName)

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

public synchronized long

Returns:

The derived gauge timestamp of the specified object.
getDerivedGaugeTimeStamp
(ObjectName
the name of the object whose derived gauge timestamp is to be returned.
object
)

Overrides javax.management.monitor.Monitor.getDerivedGaugeTimeStamp.

Implements javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp.

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

public synchronized long

Returns:

The derived gauge timestamp.
getDerivedGaugeTimeStamp
()

Implements javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp.

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.

public MBeanNotificationInfo[]
getNotificationInfo()

Overrides javax.management.NotificationBroadcasterSupport.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.getNotificationInfo.

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

public synchronized boolean

Returns:

true if the string monitor notifies when differing from the string to compare, false otherwise.
getNotifyDiffer
()

Implements javax.management.monitor.StringMonitorMBean.getNotifyDiffer.

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

public synchronized boolean

Returns:

true if the string monitor notifies when matching the string to compare, false otherwise.
getNotifyMatch
()

Implements javax.management.monitor.StringMonitorMBean.getNotifyMatch.

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

public synchronized String

Returns:

The string value.
getStringToCompare
()

Implements javax.management.monitor.StringMonitorMBean.getStringToCompare.

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

pack-priv synchronized boolean
isComparableTypeValid(ObjectName object, String attribute, Comparable<?> value)

Overrides javax.management.monitor.Monitor.isComparableTypeValid.

Check that the type of the supplied observed attribute value is one of the value types supported by this monitor.

pack-priv synchronized void
public synchronized void
setNotifyDiffer(boolean
The differing notification's on/off switch value.
value
)

Implements javax.management.monitor.StringMonitorMBean.setNotifyDiffer.

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

public synchronized void
setNotifyMatch(boolean
The matching notification's on/off switch value.
value
)

Implements javax.management.monitor.StringMonitorMBean.setNotifyMatch.

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

public synchronized void
setStringToCompare(String
The string value.
value
)

Implements javax.management.monitor.StringMonitorMBean.setStringToCompare.

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

public synchronized void
start()

Implements abstract javax.management.monitor.Monitor.start.

Implements javax.management.monitor.MonitorMBean.start.

Starts the string monitor.

public synchronized void
stop()

Implements abstract javax.management.monitor.Monitor.stop.

Implements javax.management.monitor.MonitorMBean.stop.

Stops the string monitor.

Inherited from javax.management.monitor.Monitor:
addObservedObjectbuildErrorNotificationclassForTypecomputeAlreadyNotifiedIndexcontainsObservedObjectcreateAlreadyNotifieddoStartdoStopgetAttributegetComparableFromAttributegetDerivedGaugeFromComparablegetGranularityPeriodgetObservedAttributegetObservedObjectgetObservedObjectgetObservedObjectsisActiveisAlreadyNotifiedisThresholdTypeValidisValidForTypepostDeregisterpostRegisterpreDeregisterpreRegisterremoveObservedObjectresetAllAlreadyNotifiedresetAlreadyNotifiedsetAlreadyNotifiedsetGranularityPeriodsetObservedAttributesetObservedObjectupdateAlreadyNotifiedupdateDeprecatedAlreadyNotified

Field Detail

DIFFERINGback to summary
private static final int DIFFERING
MATCHINGback to summary
private static final int MATCHING
MATCHING_OR_DIFFERINGback to summary
private static final int MATCHING_OR_DIFFERING
notifsInfoback to summary
private static final MBeanNotificationInfo[] notifsInfo
notifyDifferback to summary
private boolean notifyDiffer

Flag indicating if the string monitor notifies when differing from the string to compare.
The default value is set to false.

notifyMatchback to summary
private boolean notifyMatch

Flag indicating if the string monitor notifies when matching the string to compare.
The default value is set to false.

stringToCompareback to summary
private String stringToCompare

String to compare with the observed attribute.
The default value is an empty character sequence.

typesback to summary
private static final String[] types

Constructor Detail

StringMonitorback to summary
public StringMonitor()

Default constructor.

Method Detail

buildAlarmNotificationback to summary
pack-priv synchronized MonitorNotification buildAlarmNotification(ObjectName object, String attribute, Comparable<?> value)

Overrides javax.management.monitor.Monitor.buildAlarmNotification.

Annotations
@Override
createObservedObjectback to summary
pack-priv Monitor.ObservedObject createObservedObject(ObjectName object)

Overrides javax.management.monitor.Monitor.createObservedObject.

Factory method for ObservedObject creation.

Annotations
@Override
Since
1.6
getDerivedGaugeback to summary
public synchronized String getDerivedGauge(ObjectName object)

Overrides javax.management.monitor.Monitor.getDerivedGauge.

Implements javax.management.monitor.StringMonitorMBean.getDerivedGauge.

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

Parameters
object:ObjectName

the name of the MBean whose derived gauge is required.

Returns:String

The derived gauge of the specified object.

Annotations
@Override
getDerivedGaugeback to summary
public synchronized String getDerivedGauge()

Implements javax.management.monitor.StringMonitorMBean.getDerivedGauge.

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:String

The derived gauge.

Annotations
@Deprecated
getDerivedGaugeTimeStampback to summary
public synchronized long getDerivedGaugeTimeStamp(ObjectName object)

Overrides javax.management.monitor.Monitor.getDerivedGaugeTimeStamp.

Implements javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp.

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:ObjectName

the name of the object whose derived gauge timestamp is to be returned.

Returns:long

The derived gauge timestamp of the specified object.

Annotations
@Override
getDerivedGaugeTimeStampback to summary
public synchronized long getDerivedGaugeTimeStamp()

Implements javax.management.monitor.StringMonitorMBean.getDerivedGaugeTimeStamp.

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:long

The derived gauge timestamp.

Annotations
@Deprecated
getNotificationInfoback to summary
public MBeanNotificationInfo[] getNotificationInfo()

Overrides javax.management.NotificationBroadcasterSupport.getNotificationInfo.

Implements javax.management.NotificationBroadcaster.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:MBeanNotificationInfo[]

Doc from javax.management.NotificationBroadcaster.getNotificationInfo.

the array of possible notifications.

Annotations
@Override
getNotifyDifferback to summary
public synchronized boolean getNotifyDiffer()

Implements javax.management.monitor.StringMonitorMBean.getNotifyDiffer.

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

Returns:boolean

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

See Also
setNotifyDiffer
getNotifyMatchback to summary
public synchronized boolean getNotifyMatch()

Implements javax.management.monitor.StringMonitorMBean.getNotifyMatch.

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

Returns:boolean

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

See Also
setNotifyMatch
getStringToCompareback to summary
public synchronized String getStringToCompare()

Implements javax.management.monitor.StringMonitorMBean.getStringToCompare.

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

Returns:String

The string value.

See Also
setStringToCompare
isComparableTypeValidback to summary
pack-priv synchronized boolean isComparableTypeValid(ObjectName object, String attribute, Comparable<?> value)

Overrides javax.management.monitor.Monitor.isComparableTypeValid.

Check that the type of the supplied observed attribute value is one of the value types supported by this monitor.

Annotations
@Override
onErrorNotificationback to summary
pack-priv synchronized void onErrorNotification(MonitorNotification notification)

Overrides javax.management.monitor.Monitor.onErrorNotification.

Annotations
@Override
setNotifyDifferback to summary
public synchronized void setNotifyDiffer(boolean value)

Implements javax.management.monitor.StringMonitorMBean.setNotifyDiffer.

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

Parameters
value:boolean

The differing notification's on/off switch value.

See Also
getNotifyDiffer
setNotifyMatchback to summary
public synchronized void setNotifyMatch(boolean value)

Implements javax.management.monitor.StringMonitorMBean.setNotifyMatch.

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

Parameters
value:boolean

The matching notification's on/off switch value.

See Also
getNotifyMatch
setStringToCompareback to summary
public synchronized void setStringToCompare(String value) throws IllegalArgumentException

Implements javax.management.monitor.StringMonitorMBean.setStringToCompare.

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

Parameters
value:String

The string value.

Exceptions
IllegalArgumentException:
The specified string to compare is null.
See Also
getStringToCompare
startback to summary
public synchronized void start()

Implements abstract javax.management.monitor.Monitor.start.

Implements javax.management.monitor.MonitorMBean.start.

Starts the string monitor.

stopback to summary
public synchronized void stop()

Implements abstract javax.management.monitor.Monitor.stop.

Implements javax.management.monitor.MonitorMBean.stop.

Stops the string monitor.

javax.management.monitor back to summary

pack-priv Class StringMonitor.StringMonitorObservedObject

extends ObservedObject
Class Inheritance

Field Summary

Modifier and TypeField and Description
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final synchronized int
public final synchronized void
setStatus(int status)

Inherited from javax.management.monitor.Monitor.ObservedObject:
getAlreadyNotifiedgetDerivedGaugegetDerivedGaugeTimeStampgetObservedObjectsetAlreadyNotifiedsetDerivedGaugesetDerivedGaugeTimeStamp

Field Detail

statusback to summary
private int status

Constructor Detail

StringMonitorObservedObjectback to summary
public StringMonitorObservedObject(ObjectName observedObject)

Method Detail

getStatusback to summary
public final synchronized int getStatus()
setStatusback to summary
public final synchronized void setStatus(int status)