KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > remote > util > OrderClassLoaders


1 /*
2  * @(#)OrderClassLoaders.java 1.6 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.remote.util;
9
10 public class OrderClassLoaders extends ClassLoader JavaDoc {
11     public OrderClassLoaders(ClassLoader JavaDoc cl1, ClassLoader JavaDoc cl2) {
12     super(cl1);
13
14     this.cl2 = cl2;
15     }
16
17     protected Class JavaDoc findClass(String JavaDoc name) throws ClassNotFoundException JavaDoc {
18     try {
19         return super.findClass(name);
20     } catch (ClassNotFoundException JavaDoc cne) {
21         if (cl2 != null) {
22         return cl2.loadClass(name);
23         } else {
24         throw cne;
25         }
26     }
27     }
28
29     private ClassLoader JavaDoc cl2;
30 }
31
Popular Tags