KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > corba > se > impl > orbutil > ORBClassLoader


1 /*
2  * @(#)ORBClassLoader.java 1.5 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 package com.sun.corba.se.impl.orbutil;
8
9 /**
10  * Based on feedback from bug report 4452016, all class loading
11  * in the ORB is isolated here. It is acceptable to use
12  * Class.forName only when one is certain that the desired class
13  * should come from the core JDK.
14  */

15 public class ORBClassLoader
16 {
17     public static Class JavaDoc loadClass(String JavaDoc className)
18         throws ClassNotFoundException JavaDoc
19     {
20         return ORBClassLoader.getClassLoader().loadClass(className);
21     }
22
23     public static ClassLoader JavaDoc getClassLoader() {
24         if (Thread.currentThread().getContextClassLoader() != null)
25             return Thread.currentThread().getContextClassLoader();
26         else
27             return ClassLoader.getSystemClassLoader();
28     }
29 }
30
Popular Tags