KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > mx4j > loading > RepositoryClassLoader


1 /*
2  * Copyright (C) MX4J.
3  * All rights reserved.
4  *
5  * This software is distributed under the terms of the MX4J License version 1.0.
6  * See the terms of the MX4J License in the documentation provided with this software.
7  */

8
9 package mx4j.loading;
10
11 import java.security.SecureClassLoader JavaDoc;
12 import java.net.URL JavaDoc;
13 import java.io.InputStream JavaDoc;
14
15 import javax.management.loading.ClassLoaderRepository JavaDoc;
16
17 /**
18  * A classloader that delegates to the ClassLoaderRepository
19  *
20  * @author <a HREF="mailto:biorn_steedom@users.sourceforge.net">Simone Bordet</a>
21  * @version $Revision: 1.3 $
22  */

23 public class RepositoryClassLoader extends SecureClassLoader JavaDoc
24 {
25    private ClassLoaderRepository JavaDoc repository;
26
27    public RepositoryClassLoader(ClassLoaderRepository JavaDoc repository)
28    {
29       this.repository = repository;
30    }
31
32    public Class JavaDoc loadClass(String JavaDoc name) throws ClassNotFoundException JavaDoc
33    {
34       return repository.loadClass(name);
35    }
36 }
37
Popular Tags