Posted by: smallonely | November 20, 2003

[java] How to Make RMI Programs Use IIOP

作者: smallonely (咪嗚 =^.^=) 看板: P_smallonely
標題: [java] How to Make RMI Programs Use IIOP
時間: Thu Nov 20 18:00:53 2003

How to Make RMI Programs Use IIOP
The following steps are a general guide to converting an RMI application to

1. If you are using the RMI registry for naming services, you need to switch
to CosNaming. In the createORB() method, do not pass the org.omg.ORBClass
property. Instead, use ORB.init( args, null ). You need to do the following:

a, In both your client and server code, you need to create an InitialContext
for JNDI using the following code:
import javax.naming.*;

Context ic = new InitialContext();

b, Modify all uses of RMI registry lookup() and bind() to use JNDI lookup()
and bind() instead. For example, instead of your RMI server using:
import java.rmi.*;

Naming.rebind(“MyObject”, myObj);
import javax.naming.*;

ic.rebind(“MyObject”, myObj);

c, If the client is an applet, the client applet needs to pass this to the
JNDI CosNaming plugin. Replace the above code with the following:
import java.util.*;
import javax.naming.*;

Hashtable env = new Hashtable();
env.put(“java.naming.applet”, this);
Context ic = new InitialContext(env);

順人學長:遇到新的research問題的時候, 可以去翻一些老書…
這個東西也許是一個很簡單的model, 在數學書裡面可能會有定義…

李家同的叔叔是李鴻章^^ 所以他正義感很重 🙂

燕子回時願別來無恙 怕相思比夢還長

之器不得已BBS telnet:// 什麼板都可以開的BBS不可得志於天下



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: