
Professional Java.JDK.5.Edition (Wrox)
.pdf









Communicating between Java Components with RMI and EJB
This chapter explains how to communicate between two Java components using Remote Method Invocation (RMI) and how to also use Enterprise JavaBeans (EJB) for more enterprise-oriented architectures. It will explore the different intricacies of each Java technology and explain why one technology may not always be the right fit for all of your architecture needs. Client/server development is becoming extremely hot in the marketplace today. Applications that just exist on a desktop and are tied to a particular operating system are few and far between on the list of development tasks that are going on. With the rise of the Internet, homeland security, online banking, and online shopping, there is a significant need for applications to share information in a quick and secure manner. Therefore, new technologies continue to be developed every day to try and meet those needs.
Web services using SOAP seem to be the latest rage, but if you have ever tried to build a largescale system and imposed stringent security requirements on Web services, you can quickly see major degradation in performance. The concept of Web services that use SOAP for their protocol is grand, but the tools are not yet there from a performance and interoperability standpoint. While these tools are maturing, developers have other alternatives that perform better and are already highly scalable. RMI and EJBs have been the mature favorites and continue to prove why they are some of the best technologies to use if performance and scalability is your concern. So get started and explore these two technologies.
Remote Method Invocation
Java’s claim to fame is the “Write once, run anywhere” model. What about the need for a “Write once, communicate anywhere” model? Java’s Remote Method Invocation (RMI) is Java’s answer to writing distributed objects, and coupled with Java’s Native Interface (JNI), the need to “communicate anywhere” with different languages can be met.