[J2EE Base EJB Programming] RMI-IIOP - "Hello World" using RMI-IIOP

      He - Who? He is a professor at Samsung Multi Campus. I learned this course from him. He injected Botox in my brain during this course. He smoothed out wrinkles in my brain and there remains nothing in my head after this course. When the course ended, the only thing remained in my head was his peculiar characteristic - said, JAVA RMI is language-dependent. That means you can't call a method hi() of hello object if hello object is made from Hello class in C++. I don't know why I have to use object implemeted by C++ or other OOP language. Anyway, just imagine this situation. It can be helpful as a middle stone between RMI and EJB.
      The context is same with "Hello World" RMI version except that hello object can be used by a object implementd by any OOP language. Ask for your co-programmer to make a Hello class in RMI-IIOP version like a following diagram.

      Furthermore, the naming server is different from RMI naming server, rmiregistry; RMI-IIOP uses tnameserv. Therefore, to start RMI-IIOP naming server.
            C:\start tnameserv
      You may ask; OK, whatever. Then, should be changed to bind and look up object from naming server? Yes, you're right. Server and clinet Hello program in RMI version use Naming class, but those of RMI-IIOP version uses Context interface and InitialContext class.
      Finally, the way to compile and run RMI-IIOP program is different those of RMI version. To compile a Hello program in RMI-IIOP version,
            C:\rmic -iiop iiop.HelloImpl
To bind hello object to naming server by running HelloServer program,
            java -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
                   -Djava.naming.provider.url=iiop://localhost iiop.HelloServer
To lookup hello object from namin server by running HelloClient program,
            java -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory
                   -Djava.naming.provider.url=iiop://localhost iiop.HelloClient
      What the hell!!! OK, calm down. I agree with you that the java option is too long to type right every time. You can use Properties class, instead. Here goes a "Hello World" program in RMI-IIOP version using Properties class. Now, you can run HelloServer and HelloClient simply;
            C:\start java iiop2.HelloServer
            C:\java iiop2.HelloClient
       That's all! Now, I'd like to write a "Hello World " using SessionBean. Why don't you take a break?

  1. SDN - JAVA RMI over IIOP

by 해적 | 2007/07/10 11:38 | LessonNotes | 트랙백 | 핑백(2) | 덧글(0)

트랙백 주소 : http://bombbomb.egloos.com/tb/1327163
☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
Linked at Treasure iLand :.. at 2007/07/10 11:39

... &lt;Content&gt; RMI -- 0.9 -- SessionBean EntityBean SessionBean + EntityBean JMS MessageDrivenBean Transaction ... more

Linked at Treasure iLand :.. at 2007/07/11 10:22

... sp; You have already seen the example using JNDI API in the previous example. Prior to get down to JNDI, let's see what the naming servic ... more

:         :


비공개 덧글

◀ 이전 페이지          다음 페이지 ▶