How to cite a web site - EJB Fundamentals 43 LOCATION TRANSPARENCY EJB inherits a

EJB Fundamentals 43 LOCATION TRANSPARENCY EJB inherits a significant benefit from RMI-IIOP. In RMI-IIOP, the physical location of the remote object you re invoking is masked from you. This feature spills over to EJB. Your client code is unaware of whether the EJB object it is using is located on a machine next door or a machine across the Internet. It also means the EJB object could be located on the same JVM as the client. This is called location transparency. Why is location transparency beneficial? For one thing, you aren t writing your bean s client code to take advantage of a particular deployment configuration because you re not hard-coding machine locations. This is an essential part of reusable components that can be deployed in a wide variety of multitier situations. Location transparency also enables container vendors to provide additional value-adds, such as the ability to take down a machine on the network temporarily to perform system maintenance, install new software, or upgrade components on that machine. During maintenance, location transparency allows another machine on the network to serve up components for a component s client because that client is not dependent on the hard locations of any components. If a machine that has components on it crashes due to hardware or software error, you may be able to reroute client invocations to other machines without the client even knowing about the crash, allowing for an enhanced level of fault tolerance. To acquire a reference to an EJB object, your client code asks for an EJB object from an EJB object factory. This factory is responsible for instantiating (and destroying) EJB objects. The EJB specification calls such a factory a home object. The chief responsibilities of home objects are the following: Create EJB objects Find existing EJB objects (for entity beans, which we ll learn about in Chapter 6) Remove EJB objects Just like EJB objects, home objects are proprietary and specific to each EJB container. They contain interesting container-specific logic, such as load-balancing logic, logic to track information on a graphical administrative console, and more. And just like EJB objects, home objects are physically part of the container and are autogenerated by the container vendor s tools. The Home Interface We ve mentioned that home objects are factories for EJB objects. But how does a home object know how you d like your EJB object to be initialized? For example, one EJB object might expose an initialization method that takes an
Our window web hosting plans are bursting with features and FREE tools, at the very small rate. Sign up today window web hosting.

Leave a Reply