68 Chapter 3 You might find Ejb-client jar (Web hosting domains)
Monday, November 19th, 200768 Chapter 3 You might find Ejb-client jar files useful for saving hard disk space, so you can avoid copying the entire Ejb-jar file onto the client machine. This might be useful if you re in an applet environment. However, Ejb-client jar files are completely optional and most deployments will not make use of them. This is because hard disk space is usually not a problem, especially if the client of your application server is a Web server. Laziness will usually prevail. Understanding How to Call Beans We now take a look at the other half of the world the client side. We are now customers of the beans business logic, and we are trying to solve some real- world problem by using one or more beans together. There are two different kinds of clients. Java RMI-IIOP based clients. These clients use the Java Naming and Directory Interface (JNDI) to look up objects over a network, and they use the Java Transaction API (JTA) to control transactions. CORBA clients. Clients can also be written to the CORBA standard. This would primarily be useful if you want to call your EJB components using another language, such as C++. CORBA clients use the CORBA Naming Service (COS Naming) to look up objects over the network, and they use CORBA s Object Transaction Service (OTS) to control transactions. Whether you re using CORBA or RMI-IIOP, your client code typically breaks down like this: 1. Look up a home object. 2. Use the home object to create an EJB object. 3. Call business methods on the EJB object. 4. Remove the EJB object. You re about to see how to call EJB components from RMI-IIOP clients. This is the paradigm we ll use throughout this book. If you re interested in CORBA clients, see Appendix B. Looking up a Home Object One of the goals of EJB is that your application code should be write once, run anywhere. If you deploy a bean onto one machine and then switch it for a different machine, your code should not change because it is location transparent. EJB achieves location transparency by leveraging naming and directory services. Naming and directory services are products that store and look up
We will hook you up with a JSP web hosting at the great rate, check our jsp web hosting, and join us today!!!