EJB Fundamentals 37 The EJB Object Enterprise beans
Sunday, October 21st, 2007EJB Fundamentals 37 The EJB Object Enterprise beans are not full-fledged remote objects. When a client wants to use an instance of an enterprise bean class, the client never invokes the method directly on an actual bean instance. Rather, the invocation is intercepted by the EJB container and then delegated to the bean instance. This is the concept of request interception that we touched on earlier. By intercepting requests, the EJB container can automatically perform implicit middleware. As a component developer, this means your life is simplified greatly because you can rapidly develop components without writing, debugging, or maintaining code that calls middleware APIs. Some of the services that you get at the point of interception include: Implicit distributed transaction management. Transactions enable you to perform robust, deterministic operations in a distributed environment by setting attributes on your enterprise beans. We ll get into the details of transactions and how you can use them effectively in Chapter 12. For now, know that the EJB container provides a transaction service a low-level implementation of transaction management and coordination. The transaction service must be exposed through the Java Transaction API (JTA). The JTA is a high-level interface that you can use to control transactions, which we also cover in Chapter 12. Implicit security. Security is a major consideration for multitier deployments. The Java 2 Platform, Standard Edition yields a robust security service that can authorize and authenticate users, securing deployments from unwanted visitors. EJB adds to this the notion of transparent security, allowing components to reap the benefits of a secure deployment without necessarily coding to a security API. Implicit resource management and component life cycle. The EJB container implicitly manages resources for your enterprise beans, such as threads, sockets, and database connections. The life cycle of the enterprise beans themselves is also managed, allowing the EJB container to reuse the enterprise bean instances as necessary. Implicit persistence. Persistence is a natural requirement of any deployment that requires permanent storage. EJB offers assistance here by automatically saving persistent object data to an underlying storage and retrieving that data at a later time. Implicit remote accessibility. Your enterprise bean class cannot be called across the network directly because an enterprise bean class is not network enabled. Your EJB container handles networking for you by wrapping your bean in a network-enabled object. The network- enabled object receives calls from clients and delegates these calls to
If you need complete reliable cheap web hosting package, you come to right place. We offer all you need just check our cheap web hosting package section.