Package com.sun.appserv.management.event

Examples of com.sun.appserv.management.event.StatisticMonitorNotification


     * is set to <CODE>true</CODE>.
     * @param index The index of the observed object.
     */
    private StatisticMonitorNotification updateNotifications(int index) {

        StatisticMonitorNotification n = null;

        // Send high notification if notifyHigh is true.
        // Send low notification if notifyLow is true.
        //
        synchronized(this) {
            if (status[index] == RISING_OR_FALLING) {
                if (isFirstGreaterThanLast((Number)derivedGauge[index],
                                           highThreshold,
                                           type[index])) {
                    if (notifyHigh) {
                        n = new StatisticMonitorNotification(
                                THRESHOLD_HIGH_VALUE_EXCEEDED,
                                this,
                                0,
                                0,
                                "",
                                null,
                                null,
                                null,
                                highThreshold);
                    }
                    status[index] = FALLING;
                } else if (isFirstGreaterThanLast(lowThreshold,
                                                  (Number)derivedGauge[index],
                                                  type[index])) {
                    if (notifyLow) {
                        n = new StatisticMonitorNotification(
                                THRESHOLD_LOW_VALUE_EXCEEDED,
                                this,
                                0,
                                0,
                                "",
                                null,
                                null,
                                null,
                                lowThreshold);
                    }
                    status[index] = RISING;
                }
            } else {
                if (status[index] == RISING) {
                    if (isFirstGreaterThanLast((Number)derivedGauge[index],
                                               highThreshold,
                                               type[index])) {
                        if (notifyHigh) {
                            n = new StatisticMonitorNotification(
                                    THRESHOLD_HIGH_VALUE_EXCEEDED,
                                    this,
                                    0,
                                    0,
                                    "",
                                    null,
                                    null,
                                    null,
                                    highThreshold);
                        }
                        status[index] = FALLING;
                    }
                } else if (status[index] == FALLING) {
                    if (isFirstGreaterThanLast(lowThreshold,
                                               (Number)derivedGauge[index],
                                               type[index])) {
                        if (notifyLow) {
                            n = new StatisticMonitorNotification(
                                    THRESHOLD_LOW_VALUE_EXCEEDED,
                                    this,
                                    0,
                                    0,
                                    "",
View Full Code Here


        int index = indexOf(object);
       
        // Notify the listeners if the updated derived
        // gauge value is valid.
        //
        StatisticMonitorNotification alarm = null;
        if (derivedGaugeValid[index])
            alarm = updateNotifications(index);
        return alarm;
    }
View Full Code Here

     * is set to <CODE>true</CODE>.
     * @param index The index of the observed object.
     */
    private StatisticMonitorNotification updateNotifications(int index) {

        StatisticMonitorNotification n = null;

        // Send high notification if notifyHigh is true.
        // Send low notification if notifyLow is true.
        //
        synchronized(this) {
            if (status[index] == RISING_OR_FALLING) {
                if (isFirstGreaterThanLast((Number)derivedGauge[index],
                                           highThreshold,
                                           type[index])) {
                    if (notifyHigh) {
                        n = new StatisticMonitorNotification(
                                THRESHOLD_HIGH_VALUE_EXCEEDED,
                                this,
                                0,
                                0,
                                "",
                                null,
                                null,
                                null,
                                highThreshold);
                    }
                    status[index] = FALLING;
                } else if (isFirstGreaterThanLast(lowThreshold,
                                                  (Number)derivedGauge[index],
                                                  type[index])) {
                    if (notifyLow) {
                        n = new StatisticMonitorNotification(
                                THRESHOLD_LOW_VALUE_EXCEEDED,
                                this,
                                0,
                                0,
                                "",
                                null,
                                null,
                                null,
                                lowThreshold);
                    }
                    status[index] = RISING;
                }
            } else {
                if (status[index] == RISING) {
                    if (isFirstGreaterThanLast((Number)derivedGauge[index],
                                               highThreshold,
                                               type[index])) {
                        if (notifyHigh) {
                            n = new StatisticMonitorNotification(
                                    THRESHOLD_HIGH_VALUE_EXCEEDED,
                                    this,
                                    0,
                                    0,
                                    "",
                                    null,
                                    null,
                                    null,
                                    highThreshold);
                        }
                        status[index] = FALLING;
                    }
                } else if (status[index] == FALLING) {
                    if (isFirstGreaterThanLast(lowThreshold,
                                               (Number)derivedGauge[index],
                                               type[index])) {
                        if (notifyLow) {
                            n = new StatisticMonitorNotification(
                                    THRESHOLD_LOW_VALUE_EXCEEDED,
                                    this,
                                    0,
                                    0,
                                    "",
View Full Code Here

        int index = indexOf(object);
       
        // Notify the listeners if the updated derived
        // gauge value is valid.
        //
        StatisticMonitorNotification alarm = null;
        if (derivedGaugeValid[index])
            alarm = updateNotifications(index);
        return alarm;
    }
View Full Code Here

        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }

        StatisticMonitorNotification mn =
            new StatisticMonitorNotification(type,
                                    this,
                                    seqno,
                                    timeStamp,
                                    msg,
                                    object,
View Full Code Here

        String msg = null;
        Object derGauge = null;
        Object trigger = null;
        ObjectName object = null;
        Comparable<?> value = null;
        StatisticMonitorNotification alarm = null;

        synchronized(this) {
            if (!isActive())
                return;

            // Check that neither the observed object nor the
            // observed attribute are null.  If the observed
            // object or observed attribute is null, this means
            // that the monitor started before a complete
            // initialization and nothing is done.
            //
            object = getObservedObject(index);
            String attribute = getObservedAttribute();
            if (object == null || attribute == null) {
                return;
            }

            // Check that the observed object is registered in the
            // MBean server and that the observed attribute
            // belongs to the observed object.
            //
            Object attributeValue = null;
            try {
                attributeValue = getAttribute(server, object, attribute);
                if (attributeValue == null)
                    if (alreadyNotified(index,
                                        OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = OBSERVED_ATTRIBUTE_TYPE_ERROR;
                        setAlreadyNotified(
                                  index,
                                  OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED);
                        msg = "The observed attribute value is null.";
                        if ( _logger.isLoggable(Level.WARNING) )
                            _logger.log(Level.WARNING,msg);
                    }
            } catch (NullPointerException np_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg =
                        "The monitor must be registered in the MBean " +
                        "server or an MBeanServerConnection must be " +
                        "explicitly supplied.";
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, np_ex.toString());
                    }
                }
            } catch (InstanceNotFoundException inf_ex) {
                if (alreadyNotified(index, OBSERVED_OBJECT_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = OBSERVED_OBJECT_ERROR;
                    setAlreadyNotified(index, OBSERVED_OBJECT_ERROR_NOTIFIED);
                    msg =
                        "The observed object must be accessible in " +
                        "the MBeanServerConnection.";
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, inf_ex.toString());
                    }
                }
            } catch (AttributeNotFoundException anf_ex) {
                if (alreadyNotified(index, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = OBSERVED_ATTRIBUTE_ERROR;
                    setAlreadyNotified(index,
                                       OBSERVED_ATTRIBUTE_ERROR_NOTIFIED);
                    msg =
                        "The observed attribute must be accessible in " +
                        "the observed object.";
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, anf_ex.toString());
                    }

                }
            } catch (MBeanException mb_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg = mb_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, mb_ex.toString());
                    }
                }
            } catch (ReflectionException ref_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED)) {
                    return;
                } else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index,
                                       RUNTIME_ERROR_NOTIFIED);
                    msg = ref_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, ref_ex.toString());
                    }
                }
            } catch (IOException io_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg = io_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, io_ex.toString());
                    }
                }
            } catch (RuntimeException rt_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg = rt_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, rt_ex.toString());
                    }
                }
            }

            // Derive a Comparable object from the ObservedAttribute value
            // if the type of the ObservedAttribute value is a complex type.
            //
            if (msg == null) {
                try {
                    value = getComparableFromAttribute(object,
                                                       attribute,
                                                       attributeValue);
                } catch (AttributeNotFoundException e) {
                    if (alreadyNotified(index,
                                        OBSERVED_ATTRIBUTE_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = OBSERVED_ATTRIBUTE_ERROR;
                        setAlreadyNotified(index,
                                           OBSERVED_ATTRIBUTE_ERROR_NOTIFIED);
                        msg =
                            "The observed attribute must be accessible in " +
                            "the observed object.";
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                            _logger.log(Level.WARNING, e.toString());
                        }

                    }
                } catch (RuntimeException e) {
                    if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = RUNTIME_ERROR;
                        setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                        msg = e.getMessage();
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                            _logger.log(Level.WARNING, e.toString());
                        }
                    }
                }
            }

            // Check that the observed attribute type is supported by this
            // monitor.
            //
            if (msg == null) {
                if (!isComparableTypeValid(object, attribute, value)) {
                    if (alreadyNotified(index,
                                        OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = OBSERVED_ATTRIBUTE_TYPE_ERROR;
                        setAlreadyNotified(
                                  index,
                                  OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED);
                        msg = "The observed attribute type is not valid.";
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                        }
                    }
                }
            }

            // Check that threshold type is supported by this monitor.
            //
            if (msg == null) {
                if (!isThresholdTypeValid(object, attribute, value)) {
                    if (alreadyNotified(index, THRESHOLD_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = THRESHOLD_ERROR;
                        setAlreadyNotified(index, THRESHOLD_ERROR_NOTIFIED);
                        msg = "The threshold type is not valid.";
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                        }
                    }
                }
            }

            // Let someone subclassing the monitor to perform additional
            // monitor consistency checks and report errors if necessary.
            //
            if (msg == null) {
                msg = buildErrorNotification(object, attribute, value);
                if (msg != null) {
                    if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = RUNTIME_ERROR;
                        setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                        }
                    }
                }
            }

            // If no errors were found then clear all error flags and
            // let the monitor decide if a notification must be sent.
            //
            if (msg == null) {
                // Clear all already notified flags.
                //
                resetAllAlreadyNotified(index);

                // Get derived gauge from comparable value.
                //
                derGauge = getDerivedGaugeFromComparable(object,
                                                         attribute,
                                                         value);
                derivedGauge[index] = derGauge;
                derivedGaugeTimestamp[index] = System.currentTimeMillis();

                // Check if an alarm must be fired.
                //
                alarm = buildAlarmNotification(object,
                                               attribute,
                                               (Comparable<?>) derGauge);
            }
        }

        // Notify monitor errors
        //
        if (msg != null)
            sendNotification(notifType,
                             System.currentTimeMillis(),
                             msg,
                             derGauge,
                             trigger,
                             object,
                             true);

        // Notify monitor alarms
        //
        if (alarm != null && alarm.getType() != null) {
            sendNotification(alarm.getType(),
                             System.currentTimeMillis(),
                             alarm.getMessage(),
                             derGauge,
                             alarm.getTrigger(),
                             object,
                             false);
        }
    }
View Full Code Here

        long seqno;
        synchronized (this) {
            seqno = sequenceNumber++;
        }

        StatisticMonitorNotification mn =
            new StatisticMonitorNotification(type,
                                    this,
                                    seqno,
                                    timeStamp,
                                    msg,
                                    object,
View Full Code Here

        String msg = null;
        Object derGauge = null;
        Object trigger = null;
        ObjectName object = null;
        Comparable<?> value = null;
        StatisticMonitorNotification alarm = null;

        synchronized(this) {
            if (!isActive())
                return;

            // Check that neither the observed object nor the
            // observed attribute are null.  If the observed
            // object or observed attribute is null, this means
            // that the monitor started before a complete
            // initialization and nothing is done.
            //
            object = getObservedObject(index);
            String attribute = getObservedAttribute();
            if (object == null || attribute == null) {
                return;
            }

            // Check that the observed object is registered in the
            // MBean server and that the observed attribute
            // belongs to the observed object.
            //
            Object attributeValue = null;
            try {
                attributeValue = getAttribute(server, object, attribute);
                if (attributeValue == null)
                    if (alreadyNotified(index,
                                        OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = OBSERVED_ATTRIBUTE_TYPE_ERROR;
                        setAlreadyNotified(
                                  index,
                                  OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED);
                        msg = "The observed attribute value is null.";
                        if ( _logger.isLoggable(Level.WARNING) )
                            _logger.log(Level.WARNING,msg);
                    }
            } catch (NullPointerException np_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg =
                        "The monitor must be registered in the MBean " +
                        "server or an MBeanServerConnection must be " +
                        "explicitly supplied.";
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, np_ex.toString());
                    }
                }
            } catch (InstanceNotFoundException inf_ex) {
                if (alreadyNotified(index, OBSERVED_OBJECT_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = OBSERVED_OBJECT_ERROR;
                    setAlreadyNotified(index, OBSERVED_OBJECT_ERROR_NOTIFIED);
                    msg =
                        "The observed object must be accessible in " +
                        "the MBeanServerConnection.";
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, inf_ex.toString());
                    }
                }
            } catch (AttributeNotFoundException anf_ex) {
                if (alreadyNotified(index, OBSERVED_ATTRIBUTE_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = OBSERVED_ATTRIBUTE_ERROR;
                    setAlreadyNotified(index,
                                       OBSERVED_ATTRIBUTE_ERROR_NOTIFIED);
                    msg =
                        "The observed attribute must be accessible in " +
                        "the observed object.";
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, anf_ex.toString());
                    }

                }
            } catch (MBeanException mb_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg = mb_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, mb_ex.toString());
                    }
                }
            } catch (ReflectionException ref_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED)) {
                    return;
                } else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index,
                                       RUNTIME_ERROR_NOTIFIED);
                    msg = ref_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, ref_ex.toString());
                    }
                }
            } catch (IOException io_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg = io_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, io_ex.toString());
                    }
                }
            } catch (RuntimeException rt_ex) {
                if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                    return;
                else {
                    notifType = RUNTIME_ERROR;
                    setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                    msg = rt_ex.getMessage();
                    if ( _logger.isLoggable(Level.WARNING) ) {
                        _logger.log(Level.WARNING,msg);
                        _logger.log(Level.WARNING, rt_ex.toString());
                    }
                }
            }

            // Derive a Comparable object from the ObservedAttribute value
            // if the type of the ObservedAttribute value is a complex type.
            //
            if (msg == null) {
                try {
                    value = getComparableFromAttribute(object,
                                                       attribute,
                                                       attributeValue);
                } catch (AttributeNotFoundException e) {
                    if (alreadyNotified(index,
                                        OBSERVED_ATTRIBUTE_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = OBSERVED_ATTRIBUTE_ERROR;
                        setAlreadyNotified(index,
                                           OBSERVED_ATTRIBUTE_ERROR_NOTIFIED);
                        msg =
                            "The observed attribute must be accessible in " +
                            "the observed object.";
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                            _logger.log(Level.WARNING, e.toString());
                        }

                    }
                } catch (RuntimeException e) {
                    if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = RUNTIME_ERROR;
                        setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                        msg = e.getMessage();
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                            _logger.log(Level.WARNING, e.toString());
                        }
                    }
                }
            }

            // Check that the observed attribute type is supported by this
            // monitor.
            //
            if (msg == null) {
                if (!isComparableTypeValid(object, attribute, value)) {
                    if (alreadyNotified(index,
                                        OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = OBSERVED_ATTRIBUTE_TYPE_ERROR;
                        setAlreadyNotified(
                                  index,
                                  OBSERVED_ATTRIBUTE_TYPE_ERROR_NOTIFIED);
                        msg = "The observed attribute type is not valid.";
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                        }
                    }
                }
            }

            // Check that threshold type is supported by this monitor.
            //
            if (msg == null) {
                if (!isThresholdTypeValid(object, attribute, value)) {
                    if (alreadyNotified(index, THRESHOLD_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = THRESHOLD_ERROR;
                        setAlreadyNotified(index, THRESHOLD_ERROR_NOTIFIED);
                        msg = "The threshold type is not valid.";
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                        }
                    }
                }
            }

            // Let someone subclassing the monitor to perform additional
            // monitor consistency checks and report errors if necessary.
            //
            if (msg == null) {
                msg = buildErrorNotification(object, attribute, value);
                if (msg != null) {
                    if (alreadyNotified(index, RUNTIME_ERROR_NOTIFIED))
                        return;
                    else {
                        notifType = RUNTIME_ERROR;
                        setAlreadyNotified(index, RUNTIME_ERROR_NOTIFIED);
                        if ( _logger.isLoggable(Level.WARNING) ) {
                            _logger.log(Level.WARNING,msg);
                        }
                    }
                }
            }

            // If no errors were found then clear all error flags and
            // let the monitor decide if a notification must be sent.
            //
            if (msg == null) {
                // Clear all already notified flags.
                //
                resetAllAlreadyNotified(index);

                // Get derived gauge from comparable value.
                //
                derGauge = getDerivedGaugeFromComparable(object,
                                                         attribute,
                                                         value);
                derivedGauge[index] = derGauge;
                derivedGaugeTimestamp[index] = System.currentTimeMillis();

                // Check if an alarm must be fired.
                //
                alarm = buildAlarmNotification(object,
                                               attribute,
                                               (Comparable<?>) derGauge);
            }
        }

        // Notify monitor errors
        //
        if (msg != null)
            sendNotification(notifType,
                             System.currentTimeMillis(),
                             msg,
                             derGauge,
                             trigger,
                             object,
                             true);

        // Notify monitor alarms
        //
        if (alarm != null && alarm.getType() != null) {
            sendNotification(alarm.getType(),
                             System.currentTimeMillis(),
                             alarm.getMessage(),
                             derGauge,
                             alarm.getTrigger(),
                             object,
                             false);
        }
    }
View Full Code Here

     * is set to <CODE>true</CODE>.
     * @param index The index of the observed object.
     */
    private StatisticMonitorNotification updateNotifications(int index) {

        StatisticMonitorNotification n = null;

        synchronized(this) {
            // Send notification if notify is true.
            //
            if (!eventAlreadyNotified[index]) {
                if (((Number)derivedGauge[index]).longValue() >=
                    threshold[index].longValue()) {
                    if (notify) {
                        n = new StatisticMonitorNotification(THRESHOLD_VALUE_EXCEEDED,
                                                    this,
                                                    0,
                                                    0,
                                                    "",
                                                    null,
View Full Code Here

        int index = indexOf(object);

        // Notify the listeners and update the threshold if
        // the updated derived gauge value is valid.
        //
        StatisticMonitorNotification alarm = null;
        if (derivedGaugeValid[index]) {
            alarm = updateNotifications(index);
            updateThreshold(index);
        }
        return alarm;
View Full Code Here

TOP

Related Classes of com.sun.appserv.management.event.StatisticMonitorNotification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.