Methods Summary |
---|
com.sun.appserv.management.event.StatisticMonitorNotification | buildAlarmNotification(javax.management.ObjectName object, java.lang.String attribute, java.lang.Comparable value)
String type = null;
String msg = null;
Object trigger = null;
int index = indexOf(object);
synchronized(this) {
// Send matching notification if notifyMatch is true.
// Send differing notification if notifyDiffer is true.
//
if (status[index] == MATCHING_OR_DIFFERING) {
if (derivedGauge[index].equals(stringToCompare)) {
if (notifyMatch) {
type = STRING_TO_COMPARE_VALUE_MATCHED;
msg = "";
trigger = stringToCompare;
}
status[index] = DIFFERING;
} else {
if (notifyDiffer) {
type = STRING_TO_COMPARE_VALUE_DIFFERED;
msg = "";
trigger = stringToCompare;
}
status[index] = MATCHING;
}
} else {
if (status[index] == MATCHING) {
if (derivedGauge[index].equals(stringToCompare)) {
if (notifyMatch) {
type = STRING_TO_COMPARE_VALUE_MATCHED;
msg = "";
trigger = stringToCompare;
}
status[index] = DIFFERING;
}
} else if (status[index] == DIFFERING) {
if (!derivedGauge[index].equals(stringToCompare)) {
if (notifyDiffer) {
type = STRING_TO_COMPARE_VALUE_DIFFERED;
msg = "";
trigger = stringToCompare;
}
status[index] = MATCHING;
}
}
}
}
return new StatisticMonitorNotification(type,
this,
0,
0,
msg,
null,
null,
null,
trigger);
|
public synchronized java.lang.String | getDerivedGauge(javax.management.ObjectName object)Gets the derived gauge of the specified object, if this object is
contained in the set of observed MBeans, or null otherwise.
return (String) super.getDerivedGauge(object);
|
public synchronized java.lang.String | getDerivedGauge()Returns the derived gauge of the first object in the set of
observed MBeans.
return (String) derivedGauge[0];
|
public synchronized long | getDerivedGaugeTimeStamp(javax.management.ObjectName object)Gets the derived gauge timestamp of the specified object, if
this object is contained in the set of observed MBeans, or
null otherwise.
return super.getDerivedGaugeTimeStamp(object);
|
public synchronized long | getDerivedGaugeTimeStamp()Gets the derived gauge timestamp of the first object in the set
of observed MBeans.
return derivedGaugeTimestamp[0];
|
public javax.management.MBeanNotificationInfo[] | getNotificationInfo()Returns a NotificationInfo object containing the name of
the Java class of the notification and the notification types sent by
the string statistic monitor.
return notifsInfo.clone();
|
public synchronized boolean | getNotifyDiffer()Gets the differing notification's on/off switch value common to
all observed MBeans.
return notifyDiffer;
|
public synchronized boolean | getNotifyMatch()Gets the matching notification's on/off switch value common to
all observed MBeans.
return notifyMatch;
|
public synchronized java.lang.String | getStringToCompare()Gets the string to compare with the observed attribute common
to all observed MBeans.
return stringToCompare;
|
synchronized void | insertSpecificElementAt(int index)This method is called when adding a new observed object in the vector.
It updates all the string specific arrays.
// Update status array.
//
if (elementCount >= status.length) {
status = expandArray(status);
}
status[index] = MATCHING_OR_DIFFERING;
|
boolean | isComparableTypeValid(javax.management.ObjectName object, java.lang.String attribute, java.lang.Comparable value)Check that the type of the supplied observed attribute
value is one of the value types supported by this monitor.
// Check that the observed attribute is of type "String".
//
if (value instanceof String) {
return true;
}
return false;
|
void | onErrorNotification(com.sun.appserv.management.event.StatisticMonitorNotification notification)
int index = indexOf(notification.getObservedObject());
synchronized(this) {
// Reset values.
//
status[index] = MATCHING_OR_DIFFERING;
}
|
synchronized void | removeSpecificElementAt(int index)This method is called when removing an observed object from the vector.
It updates all the string specific arrays.
// Update status array.
//
removeElementAt(status, index);
|
public synchronized void | setNotifyDiffer(boolean value)Sets the differing notification's on/off switch value common to
all observed MBeans.
notifyDiffer = value;
|
public synchronized void | setNotifyMatch(boolean value)Sets the matching notification's on/off switch value common to
all observed MBeans.
notifyMatch = value;
|
public synchronized void | setStringToCompare(java.lang.String value)Sets the string to compare with the observed attribute common
to all observed MBeans.
if (value == null) {
throw new IllegalArgumentException("Null string to compare");
}
stringToCompare = value;
// Reset values.
//
for (int i = 0; i < elementCount; i++) {
status[i] = MATCHING_OR_DIFFERING;
}
|
public synchronized void | start()Starts the string monitor.
// Reset values.
//
for (int i = 0; i < elementCount; i++) {
status[i] = MATCHING_OR_DIFFERING;
}
doStart();
|
public synchronized void | stop()Stops the string monitor.
doStop();
|