< prev index next >

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

Print this page

    2424     }
    2425
    2426     static final Permission controlPermission =
    2427             new LoggingPermission("control", null);
    2428
    2429     void checkPermission() {
    2430         SecurityManager sm = System.getSecurityManager();
    2431         if (sm != null)
    2432             sm.checkPermission(controlPermission);
    2433     }
    2434
    2435     /**
    2436      * Check that the current context is trusted to modify the logging
    2437      * configuration.  This requires LoggingPermission("control").
    2438      * <p>
    2439      * If the check fails we throw a SecurityException, otherwise
    2440      * we return normally.
    2441      *
    2442      * @throws  SecurityException  if a security manager exists and if
    2443      *             the caller does not have LoggingPermission("control").

    2444      */

    2445     public void checkAccess() throws SecurityException {
    2446         checkPermission();
    2447     }
    2448
    2449     // Nested class to represent a node in our tree of named loggers.
    2450     private static class LogNode {
    2451         HashMap<String,LogNode> children;
    2452         LoggerWeakRef loggerRef;
    2453         LogNode parent;
    2454         final LoggerContext context;
    2455
    2456         LogNode(LogNode parent, LoggerContext context) {
    2457             this.parent = parent;
    2458             this.context = context;
    2459         }
    2460
    2461         // Recursive method to walk the tree below a node and set
    2462         // a new parent logger.
    2463         void walkAndSetParent(Logger parent) {
    2464             if (children == null) {
    2424     }
    2425
    2426     static final Permission controlPermission =
    2427             new LoggingPermission("control", null);
    2428
    2429     void checkPermission() {
    2430         SecurityManager sm = System.getSecurityManager();
    2431         if (sm != null)
    2432             sm.checkPermission(controlPermission);
    2433     }
    2434
    2435     /**
    2436      * Check that the current context is trusted to modify the logging
    2437      * configuration.  This requires LoggingPermission("control").
    2438      * <p>
    2439      * If the check fails we throw a SecurityException, otherwise
    2440      * we return normally.
    2441      *
    2442      * @throws  SecurityException  if a security manager exists and if
    2443      *             the caller does not have LoggingPermission("control").
    2444      * @deprecated This method is only useful in conjunction with
    2445      *       {@linkplain SecurityManager the Security Manager}, which is
    2446      *       deprecated and subject to removal in a future release.
    2447      *       Consequently, this method is also deprecated and subject to
    2448      *       removal. There is no replacement for the Security Manager or this
    2449      *       method.
    2450      */
    2451     @Deprecated(since="17", forRemoval=true)
    2452     public void checkAccess() throws SecurityException {
    2453         checkPermission();
    2454     }
    2455
    2456     // Nested class to represent a node in our tree of named loggers.
    2457     private static class LogNode {
    2458         HashMap<String,LogNode> children;
    2459         LoggerWeakRef loggerRef;
    2460         LogNode parent;
    2461         final LoggerContext context;
    2462
    2463         LogNode(LogNode parent, LoggerContext context) {
    2464             this.parent = parent;
    2465             this.context = context;
    2466         }
    2467
    2468         // Recursive method to walk the tree below a node and set
    2469         // a new parent logger.
    2470         void walkAndSetParent(Logger parent) {
    2471             if (children == null) {

< prev index next >