Example usage for java.beans PropertyChangeListener getClass

List of usage examples for java.beans PropertyChangeListener getClass

Introduction

In this page you can find the example usage for java.beans PropertyChangeListener getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:net.chaosserver.timelord.util.PropertyChangeSupport.java

/**
 * Adds a property change listener to the source and will log
 * a warning error if it goes over the maxListeners.
 *
 * @param listener the listener to add.//w w w .j av  a2  s. c om
 */
public void addPropertyChangeListener(PropertyChangeListener listener) {
    super.addPropertyChangeListener(listener);

    if (log.isWarnEnabled()) {
        PropertyChangeListener[] listeners = getPropertyChangeListeners();
        if (listeners.length > maxListeners) {
            log.warn("[" + sourceBean.getClass().getName() + "] has too many listeners [" + listeners.length
                    + "] when adding [" + listener.getClass().getName() + "]");
        }
    }
}