List of usage examples for java.beans PropertyChangeListener getClass
@HotSpotIntrinsicCandidate public final native Class<?> getClass();
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() + "]"); } } }