Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openj9
Path: blob/master/jcl/src/java.logging/share/classes/java/util/logging/LoggingMXBean.java
12576 views
1
/*[INCLUDE-IF Sidecar17 & !Sidecar19-SE]*/
2
/*******************************************************************************
3
* Copyright (c) 2005, 2017 IBM Corp. and others
4
*
5
* This program and the accompanying materials are made available under
6
* the terms of the Eclipse Public License 2.0 which accompanies this
7
* distribution and is available at https://www.eclipse.org/legal/epl-2.0/
8
* or the Apache License, Version 2.0 which accompanies this distribution and
9
* is available at https://www.apache.org/licenses/LICENSE-2.0.
10
*
11
* This Source Code may also be made available under the following
12
* Secondary Licenses when the conditions for such availability set
13
* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
14
* General Public License, version 2 with the GNU Classpath
15
* Exception [1] and GNU General Public License, version 2 with the
16
* OpenJDK Assembly Exception [2].
17
*
18
* [1] https://www.gnu.org/software/classpath/license.html
19
* [2] http://openjdk.java.net/legal/assembly-exception.html
20
*
21
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
22
*******************************************************************************/
23
package java.util.logging;
24
25
import java.util.List;
26
27
/**
28
* The management and monitoring interface for the logging system of the
29
* virtual machine.
30
* <p>
31
* Precisely one instance of this interface will be made available to management
32
* clients.
33
* </p>
34
* <p>
35
* Accessing this <code>MXBean</code> can be done in one of three ways. <br/>
36
* <ol>
37
* <li>Invoking the static {@link LogManager#getLoggingMXBean()}method.
38
* </li>
39
* <li>Using a javax.management.MBeanServerConnection.</li>
40
* <li>Obtaining a proxy MXBean from the static
41
* {@link ManagementFactory#newPlatformMXBeanProxy}method, passing in
42
* &quot;java.util.logging:type=Logging&quot; for the value of the second parameter.
43
* </li>
44
* </ol>
45
* </p>
46
*
47
* @since 1.5
48
*/
49
public interface LoggingMXBean {
50
51
/**
52
* Returns the string name of the specified {@link Logger}instance's
53
* current log level.
54
*
55
* @param loggerName
56
* the name of a particular <code>Logger</code> instance
57
* @return if <code>loggerName</code> resolves to an existing registered
58
* <code>Logger</code> instance, the log level of that instance.
59
* Note that if it is the case that the <code>Logger</code> just
60
* inherits its log level rather than specifying its own, then an
61
* empty string (<code>&quot;&quot;</code>) will be returned. If
62
* <code>loggerName</code> does not resolve to a registered
63
* instance of <code>Logger</code> then a <code>null</code>
64
* value is returned.
65
*/
66
public String getLoggerLevel(String loggerName);
67
68
/**
69
* Returns a list of the names of all of the currently registered
70
* <code>Logger</code> instances.
71
* @return a list of the names of all registered <code>Logger</code> objects.
72
*/
73
public List<String> getLoggerNames();
74
75
/**
76
* Returns the name of the parent {@link Logger}of the specified registered
77
* <code>Logger</code>,<code>loggerName</code>.
78
*
79
* @param loggerName
80
* the name of a particular <code>Logger</code> instance
81
* @return if <code>loggerName</code> resolves to an existing registered
82
* <code>Logger</code> instance, the name of its parent
83
* <code>Logger</code>. If the <code>Logger</code> is the root
84
* entry in the <code>Logger</code> hierarchy, then an empty
85
* string (<code>&quot;&quot;</code>) will be returned. If
86
* <code>loggerName</code> does not resolve to a registered
87
* instance of <code>Logger</code> then a <code>null</code>
88
* value is returned.
89
*/
90
public String getParentLoggerName(String loggerName);
91
92
/**
93
* Attempts to update the log level of the {@link Logger} with name
94
* <code>loggerName</code> to <code>levelName</code>.
95
* <p>
96
* If <code>levelName</code> is <code>null</code> then the <code>Logger</code>
97
* instance's log level is set to be <code>null</code> with the result that
98
* it will inherit its log level from its nearest parent which does not have
99
* a <code>null</code> log level value.
100
* </p>
101
* @param loggerName the name of a registered <code>Logger</code>
102
* @param levelName the name of the new log level. May be <code>null</code>,
103
* in which case <code>loggerName</code> will inherit the log level of its
104
* closest parent with a non-<code>null</code> log level.
105
* @throws IllegalArgumentException if there is no <code>Logger</code>
106
* with the name <code>loggerName</code>. Also may be thrown if
107
* <code>loggerName</code> is not a known log level name.
108
* @throws SecurityException if there is a security manager active and
109
* the caller does not have {@link LoggingPermission} of &quot;control&quot;.
110
*/
111
public void setLoggerLevel(String loggerName, String levelName);
112
}
113
114