Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.logging/share/classes/java/util/logging/LoggingMXBean.java
41159 views
1
/*
2
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
package java.util.logging;
27
28
29
/**
30
* The management interface for the logging facility.
31
*
32
* {@link java.lang.management.PlatformLoggingMXBean
33
* java.lang.management.PlatformLoggingMXBean} is the management interface
34
* for logging facility registered in the {@link
35
* java.lang.management.ManagementFactory#getPlatformMBeanServer()
36
* platform MBeanServer}.
37
* It is recommended to use the {@code PlatformLoggingMXBean} obtained via
38
* the {@link java.lang.management.ManagementFactory#getPlatformMXBean(Class)
39
* ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)} method.
40
*
41
* @deprecated {@code LoggingMXBean} is no longer a {@link
42
* java.lang.management.PlatformManagedObject platform MXBean} and is replaced
43
* with {@link java.lang.management.PlatformLoggingMXBean}.
44
* It will not register in the platform {@code MBeanServer}.
45
* Use {@code ManagementFactory.getPlatformMXBean(PlatformLoggingMXBean.class)}
46
* instead.
47
*
48
* @author Ron Mann
49
* @author Mandy Chung
50
* @since 1.5
51
*
52
* @see java.lang.management.PlatformLoggingMXBean
53
*/
54
@Deprecated(since="9")
55
public interface LoggingMXBean {
56
57
/**
58
* Returns the list of currently registered logger names. This method
59
* calls {@link LogManager#getLoggerNames} and returns a list
60
* of the logger names.
61
*
62
* @return A list of {@code String} each of which is a
63
* currently registered {@code Logger} name.
64
*/
65
public java.util.List<String> getLoggerNames();
66
67
/**
68
* Gets the name of the log level associated with the specified logger.
69
* If the specified logger does not exist, {@code null}
70
* is returned.
71
* This method first finds the logger of the given name and
72
* then returns the name of the log level by calling:
73
* <blockquote>
74
* {@link Logger#getLevel Logger.getLevel()}.{@link Level#getName getName()};
75
* </blockquote>
76
*
77
* <p>
78
* If the {@code Level} of the specified logger is {@code null},
79
* which means that this logger's effective level is inherited
80
* from its parent, an empty string will be returned.
81
*
82
* @param loggerName The name of the {@code Logger} to be retrieved.
83
*
84
* @return The name of the log level of the specified logger; or
85
* an empty string if the log level of the specified logger
86
* is {@code null}. If the specified logger does not
87
* exist, {@code null} is returned.
88
*
89
* @see Logger#getLevel
90
*/
91
public String getLoggerLevel(String loggerName);
92
93
/**
94
* Sets the specified logger to the specified new level.
95
* If the {@code levelName} is not {@code null}, the level
96
* of the specified logger is set to the parsed {@code Level}
97
* matching the {@code levelName}.
98
* If the {@code levelName} is {@code null}, the level
99
* of the specified logger is set to {@code null} and
100
* the effective level of the logger is inherited from
101
* its nearest ancestor with a specific (non-null) level value.
102
*
103
* @param loggerName The name of the {@code Logger} to be set.
104
* Must be non-null.
105
* @param levelName The name of the level to set on the specified logger,
106
* or {@code null} if setting the level to inherit
107
* from its nearest ancestor.
108
*
109
* @throws IllegalArgumentException if the specified logger
110
* does not exist, or {@code levelName} is not a valid level name.
111
*
112
* @throws SecurityException if a security manager exists and if
113
* the caller does not have LoggingPermission("control").
114
*
115
* @see Logger#setLevel
116
*/
117
public void setLoggerLevel(String loggerName, String levelName);
118
119
/**
120
* Returns the name of the parent for the specified logger.
121
* If the specified logger does not exist, {@code null} is returned.
122
* If the specified logger is the root {@code Logger} in the namespace,
123
* the result will be an empty string.
124
*
125
* @param loggerName The name of a {@code Logger}.
126
*
127
* @return the name of the nearest existing parent logger;
128
* an empty string if the specified logger is the root logger.
129
* If the specified logger does not exist, {@code null}
130
* is returned.
131
*/
132
public String getParentLoggerName(String loggerName);
133
}
134
135