?? rmilookup.java
字號:
// ==================== Program Discription ==========================
// 程序名稱:示例10-1 : RMILookup.java
// 程序目的:通過JNDI查找RMI-IIOP服務(wù)器
// ==============================================================
import javax.naming.*;
import java.rmi.*;
public class RMILookup
{
public static void main (String[] args) throws RemoteException
{
try {
// lookup remote object through jndi
Context ctx = new InitialContext(System.getProperties());
Object remoteObject = ctx.lookup("Hello");
// conver the object into RMI-IIOP style
Greeter greeter = (Greeter) javax.rmi.PortableRemoteObject.narrow(
remoteObject, Greeter.class);
}
catch (RemoteException e)
{
e.printStackTrace();
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -