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

http://java.sun.com/j2se/1.4.2/docs/guide/rmi-iiop/rmi_iiop_pg.html

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

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);
use:
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://wretch.twbbs.org 什麼板都可以開的BBS不可得志於天下
矣吉事尚左凶事尚右偏將軍居左上將軍居右言以喪禮處之殺人之眾以哀悲泣之戰勝以
喪禮處之道常無名樸雖小天下莫能臣侯王若能守之萬物將自賓天地相合以降甘露民莫
之令而自均始制有名名亦既有夫亦將知止知止可以不殆譬道pcs.csie.nctu.edu.tw海






—–


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Categories

%d bloggers like this: