1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package kortsoft.kmx.jmx;
17
18 import java.io.InputStream;
19 import java.net.URL;
20
21 /***
22 * <a href="ManagedClassLoader.java.html"><b><i>View Source</i></b></a>
23 *
24 * @author Alvaro
25 * @version $Revision: 1.1 $
26 *
27 */
28 public class ManagedClassLoader extends ClassLoader implements
29 ManagedClassLoaderMBean {
30 private ClassLoader delegatedClassLoader;
31
32 public ManagedClassLoader(ClassLoader classLoader){
33 super();
34 this.delegatedClassLoader=classLoader;
35 }
36
37
38
39
40 public synchronized void clearAssertionStatus() {
41 delegatedClassLoader.clearAssertionStatus();
42 }
43
44
45
46 public URL getResource(String arg0) {
47 return delegatedClassLoader.getResource(arg0);
48 }
49
50
51
52 public InputStream getResourceAsStream(String arg0) {
53 return delegatedClassLoader.getResourceAsStream(arg0);
54 }
55
56
57
58 public Class<?> loadClass(String arg0) throws ClassNotFoundException {
59 return delegatedClassLoader.loadClass(arg0);
60 }
61
62
63
64 public synchronized void setClassAssertionStatus(String arg0, boolean arg1) {
65 delegatedClassLoader.setClassAssertionStatus(arg0, arg1);
66 }
67
68
69
70 public synchronized void setDefaultAssertionStatus(boolean arg0) {
71 delegatedClassLoader.setDefaultAssertionStatus(arg0);
72 }
73
74
75
76 public synchronized void setPackageAssertionStatus(String arg0, boolean arg1) {
77 delegatedClassLoader.setPackageAssertionStatus(arg0, arg1);
78 }
79
80
81 /***
82 * @return Returns the delegatedClassLoader.
83 */
84 public ClassLoader getDelegatedClassLoader() {
85 return delegatedClassLoader;
86 }
87 }