src/share/classes/java/util/logging/LogManager.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File jdk Sdiff src/share/classes/java/util/logging

src/share/classes/java/util/logging/LogManager.java

Print this page




 285                                     sun.util.logging.PlatformLogger.redirectPlatformLoggers();
 286 
 287                                     return null;
 288                                 }
 289                             });
 290                     } catch (Exception ex) {
 291                         // System.err.println("Can't read logging configuration:");
 292                         // ex.printStackTrace();
 293                     }
 294                 }
 295             }
 296         }
 297     }
 298 
 299     /**
 300      * Adds an event listener to be invoked when the logging
 301      * properties are re-read. Adding multiple instances of
 302      * the same event Listener results in multiple entries
 303      * in the property event listener table.
 304      *




 305      * @param l  event listener
 306      * @exception  SecurityException  if a security manager exists and if
 307      *             the caller does not have LoggingPermission("control").
 308      * @exception NullPointerException if the PropertyChangeListener is null.
 309      * @deprecated The dependency on {@code PropertyChangeListener} creates a
 310      *             significant impediment to future modularization of the Java
 311      *             platform. This method will be removed in a future release.
 312      *             The global {@code LogManager} can detect changes to the
 313      *             logging configuration by overridding the {@link
 314      *             #readConfiguration readConfiguration} method.
 315      */
 316     @Deprecated
 317     public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException {
 318         PropertyChangeListener listener = Objects.requireNonNull(l);
 319         checkPermission();
 320         synchronized (listenerMap) {
 321             // increment the registration count if already registered
 322             Integer value = listenerMap.get(listener);
 323             value = (value == null) ? 1 : (value + 1);
 324             listenerMap.put(listener, value);
 325         }
 326     }
 327 
 328     /**
 329      * Removes an event listener for property change events.
 330      * If the same listener instance has been added to the listener table
 331      * through multiple invocations of <CODE>addPropertyChangeListener</CODE>,
 332      * then an equivalent number of
 333      * <CODE>removePropertyChangeListener</CODE> invocations are required to remove
 334      * all instances of that listener from the listener table.
 335      * <P>
 336      * Returns silently if the given listener is not found.




 337      *
 338      * @param l  event listener (can be null)
 339      * @exception  SecurityException  if a security manager exists and if
 340      *             the caller does not have LoggingPermission("control").
 341      * @deprecated The dependency on {@code PropertyChangeListener} creates a
 342      *             significant impediment to future modularization of the Java
 343      *             platform. This method will be removed in a future release.
 344      *             The global {@code LogManager} can detect changes to the
 345      *             logging configuration by overridding the {@link
 346      *             #readConfiguration readConfiguration} method.
 347      */
 348     @Deprecated
 349     public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException {
 350         checkPermission();
 351         if (l != null) {
 352             PropertyChangeListener listener = l;
 353             synchronized (listenerMap) {
 354                 Integer value = listenerMap.get(listener);
 355                 if (value != null) {
 356                     // remove from map if registration count is 1, otherwise




 285                                     sun.util.logging.PlatformLogger.redirectPlatformLoggers();
 286 
 287                                     return null;
 288                                 }
 289                             });
 290                     } catch (Exception ex) {
 291                         // System.err.println("Can't read logging configuration:");
 292                         // ex.printStackTrace();
 293                     }
 294                 }
 295             }
 296         }
 297     }
 298 
 299     /**
 300      * Adds an event listener to be invoked when the logging
 301      * properties are re-read. Adding multiple instances of
 302      * the same event Listener results in multiple entries
 303      * in the property event listener table.
 304      *
 305      * <p><b>WARNING:</b> This method is omitted from this class in all subset
 306      * Profiles of Java SE that do not include the {@code java.beans} package.
 307      * </p>
 308      *
 309      * @param l  event listener
 310      * @exception  SecurityException  if a security manager exists and if
 311      *             the caller does not have LoggingPermission("control").
 312      * @exception NullPointerException if the PropertyChangeListener is null.
 313      * @deprecated The dependency on {@code PropertyChangeListener} creates a
 314      *             significant impediment to future modularization of the Java
 315      *             platform. This method will be removed in a future release.
 316      *             The global {@code LogManager} can detect changes to the
 317      *             logging configuration by overridding the {@link
 318      *             #readConfiguration readConfiguration} method.
 319      */
 320     @Deprecated
 321     public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException {
 322         PropertyChangeListener listener = Objects.requireNonNull(l);
 323         checkPermission();
 324         synchronized (listenerMap) {
 325             // increment the registration count if already registered
 326             Integer value = listenerMap.get(listener);
 327             value = (value == null) ? 1 : (value + 1);
 328             listenerMap.put(listener, value);
 329         }
 330     }
 331 
 332     /**
 333      * Removes an event listener for property change events.
 334      * If the same listener instance has been added to the listener table
 335      * through multiple invocations of <CODE>addPropertyChangeListener</CODE>,
 336      * then an equivalent number of
 337      * <CODE>removePropertyChangeListener</CODE> invocations are required to remove
 338      * all instances of that listener from the listener table.
 339      * <P>
 340      * Returns silently if the given listener is not found.
 341      *
 342      * <p><b>WARNING:</b> This method is omitted from this class in all subset
 343      * Profiles of Java SE that do not include the {@code java.beans} package.
 344      * </p>
 345      *
 346      * @param l  event listener (can be null)
 347      * @exception  SecurityException  if a security manager exists and if
 348      *             the caller does not have LoggingPermission("control").
 349      * @deprecated The dependency on {@code PropertyChangeListener} creates a
 350      *             significant impediment to future modularization of the Java
 351      *             platform. This method will be removed in a future release.
 352      *             The global {@code LogManager} can detect changes to the
 353      *             logging configuration by overridding the {@link
 354      *             #readConfiguration readConfiguration} method.
 355      */
 356     @Deprecated
 357     public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException {
 358         checkPermission();
 359         if (l != null) {
 360             PropertyChangeListener listener = l;
 361             synchronized (listenerMap) {
 362                 Integer value = listenerMap.get(listener);
 363                 if (value != null) {
 364                     // remove from map if registration count is 1, otherwise


src/share/classes/java/util/logging/LogManager.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File