KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cn > candle > rmi > Naming


1 package cn.candle.rmi;
2
3 import java.rmi.NotBoundException JavaDoc;
4 import java.rmi.RemoteException JavaDoc;
5
6 /**
7  * @author zhouj
8  *
9  *
10  */

11 public final class Naming {
12
13     public static Object JavaDoc lookup(String JavaDoc name)
14         throws NotBoundException JavaDoc, RemoteException JavaDoc {
15         Handler handler = null;
16         try {
17             handler =
18                 (Handler) Class
19                     .forName("cn.candle.rmi.InvokeHandler")
20                     .newInstance();
21         } catch (InstantiationException JavaDoc e) {
22             // TODO 自动生成 catch 块
23
e.printStackTrace();
24         } catch (IllegalAccessException JavaDoc e) {
25             // TODO 自动生成 catch 块
26
e.printStackTrace();
27         } catch (ClassNotFoundException JavaDoc e) {
28             // TODO 自动生成 catch 块
29
e.printStackTrace();
30         }
31         return handler.handle(name);
32     }
33
34 }
35
Popular Tags