Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.management/share/classes/javax/management/DefaultLoaderRepository.java
41155 views
1
/*
2
* Copyright (c) 1999, 2020, 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 javax.management;
27
28
import javax.management.loading.ClassLoaderRepository;
29
30
/**
31
* <p>Keeps the list of Class Loaders registered in the MBean Server.
32
* It provides the necessary methods to load classes using the registered
33
* Class Loaders.</p>
34
*
35
* <p>This deprecated class is maintained for compatibility. In
36
* previous versions of the JMX API, there was one
37
* <code>DefaultLoaderRepository</code> shared by all MBean servers.
38
* As of version 1.2 of the JMX API, that functionality is
39
* approximated by using {@link MBeanServerFactory#findMBeanServer} to
40
* find all known MBean servers, and consulting the {@link
41
* ClassLoaderRepository} of each one. It is strongly recommended
42
* that code referencing <code>DefaultLoaderRepository</code> be
43
* rewritten.</p>
44
*
45
* @deprecated Use
46
* {@link javax.management.MBeanServer#getClassLoaderRepository()}
47
* instead.
48
*
49
* @since 1.5
50
*/
51
@Deprecated
52
public class DefaultLoaderRepository {
53
/**
54
* Constructs an {@code DefaultLoaderRepository}.
55
*/
56
public DefaultLoaderRepository() {}
57
58
/**
59
* Go through the list of class loaders and try to load the requested class.
60
* The method will stop as soon as the class is found. If the class
61
* is not found the method will throw a <CODE>ClassNotFoundException</CODE>
62
* exception.
63
*
64
* @param className The name of the class to be loaded.
65
*
66
* @return the loaded class.
67
*
68
* @exception ClassNotFoundException The specified class could not be found.
69
*/
70
public static Class<?> loadClass(String className)
71
throws ClassNotFoundException {
72
return javax.management.loading.DefaultLoaderRepository.loadClass(className);
73
}
74
75
76
/**
77
* Go through the list of class loaders but exclude the given class loader, then try to load
78
* the requested class.
79
* The method will stop as soon as the class is found. If the class
80
* is not found the method will throw a <CODE>ClassNotFoundException</CODE>
81
* exception.
82
*
83
* @param className The name of the class to be loaded.
84
* @param loader The class loader to be excluded.
85
*
86
* @return the loaded class.
87
*
88
* @exception ClassNotFoundException The specified class could not be found.
89
*/
90
public static Class<?> loadClassWithout(ClassLoader loader,String className)
91
throws ClassNotFoundException {
92
return javax.management.loading.DefaultLoaderRepository.loadClassWithout(loader, className);
93
}
94
95
}
96
97