/** * Constructs an instance of {@code Level} taking the supplied name, level * value and resource bundle name. * * @param name * the name of the level. * @param level * an integer value indicating the level. * @param resourceBundleName * the name of the resource bundle to use. * @throws NullPointerException * if {@code name} is {@code null}. */ protected Level(String name, int level, String resourceBundleName) { if (name == null) { // logging.1C=The 'name' parameter is null. throw new java.lang.NullPointerException("The 'name' parameter is null."); //$NON-NLS-1$ } this.name = name; this.value = level; this.resourceBundleName = resourceBundleName; if (resourceBundleName != null) { try { rb = ResourceBundle.getBundle(resourceBundleName, Locale .getDefault(), this.GetType().getClass().getClassLoader()); } catch (MissingResourceException) { rb = null; } } lock (levels) { levels.add(this); } }
public void addPropertyChangeListener( PropertyChangeListener listener) { lock (this){ if (listener is PropertyChangeListenerProxy) { String name = ((PropertyChangeListenerProxy)listener) .getPropertyName(); PropertyChangeListener lst = (PropertyChangeListener)((PropertyChangeListenerProxy)listener) .getListener(); addPropertyChangeListener(name, lst); } else if (listener != null) { globalListeners.add(listener); } } }