EJB Fundamentals 39 (Web server extensions) EJB Container/Server Enterprise Bean Client
EJB Fundamentals 39 EJB Container/Server Enterprise Bean Client Code, such as Servlets or Applets 1: Call a Method EJB Object Remote Interface 4: Method Returns 5: Return Result 3: Call a Bean Transaction Service, Security Service, Persistence Sevice, etc 2: Call Middleware APIs Figure 2.5 EJB objects. Each EJB container ships with a suite of glue-code tools. These tools are meant to integrate beans into the EJB container s environment. The tools generate helper Java code stubs, skeletons, data access classes, and other classes that this specific container requires. Bean providers do not have to think about the specifics of how each EJB container works because the container s tools generate its own proprietary Java code automatically. The container s glue-code tools are responsible for transforming an enterprise bean into a fully managed, distributed server-side component. This involves logic to handle resource management, life cycle, state management, transactions, security, persistence, remote accessibility, and many other services. The generated code handles these services in the container s proprietary way. The Remote Interface As mentioned previously, bean clients invoke methods on EJB objects, rather than the beans themselves. Therefore, EJB objects must clone every business method that your bean classes expose. But how do the tools that autogenerate EJB objects know which methods to clone? The answer is in a special interface that a bean provider writes. This interface duplicates all the business logic methods that the corresponding bean class exposes. This interface is called the remote interface. Remote interfaces must comply with special rules that the EJB specification defines. For example, all remote interfaces must derive from a common interface supplied by Sun Microsystems. This interface is called javax.ejb.EJBObject, and it is shown in Source 2.2.
Do you want truly affordable web hosting? With us, what you see is what you get, just click on affordable web hosting services.