Personal web server - the user session, and possibly the database, instead
the user session, and possibly the database, instead of making use of stateful session beans. For this reason, we’ll focus on stateless beans for our examples here. The EJB 2.0 specification added message-driven beans as the third bean type so that EJB could be integrated with the Java Message Service (JMS). Message-driven beans differ from the other two types in that they respond asynchronously to requests instead of being called directly by a client application. The container invokes a message-driven bean whenever a JMS message that meets the selection criteria of the bean is received. For example, in a more complex version of the Storefront application, a message-driven bean could be used to respond to a notification that an item is being backordered. The bean could be responsible for emailing any customers that had orders already in place for the item. Message-driven beans have no direct interaction with client applications, so they are even less dependent on the client than entity beans are. 13.1.2 The Session Fa ade The first step in designing an interface to the application tier is to identify the entry points exposed to a client application. Message-driven beans aren’t called directly, so they don’t come into play here. However, a typical EJB application can include a number of session and entity beans. As already pointed out, standard practice is to insulate entity beans from the details of the client so that they can be reused in other applications. If your Struts actions were to interact with entity beans directly, the web tier would quickly become coupled to the object model implemented by the application tier. This tight coupling, combined with the distributed nature of EJB, would lead to a number of issues: Changes in the EJB object model would require corresponding changes in the web tier. Action classes often would be required to execute multiple remote calls to the application server to satisfy the business logic needs of a request. The business logic and transaction-management code needed to orchestrate multiple calls would have to exist in the web tier. To avoid these issues, the interface exposed to the clients of the application tier is almost always limited to session beans. This approach is commonly referred to as either “session wraps entity” or a ” session fa ade.” There are quite a few advantages to this design. When a client application makes a single call to a session-bean method to perform a required operation, the session bean can easily execute the request as a single transaction, and the implementation details can be hidden. This session- bean method might need to access a number of entity beans, or even other session beans, to satisfy the request. No matter what the flow of control is on the application server, the complexity is hidden from the client. Because session beans become the only clients of the entity beans when using a session fa ade, there’s little chance of the entities becoming tied to any particular type of external client. Even though the discussion here assumes that the business objects are implemented as entity beans, this doesn’t have to be the case in an EJB application. The same concerns and advantages that support using a session fa ade apply when other implementations are used. Just as some Java developers don’t like EJB, not all EJB developers like entity beans. Because the session fa ade hides the object model from the client, entity beans can be replaced with another approach, such as Java data objects (JDOs) or regular data access objects (DAOs), without impacting the interface exposed to the client.
We recommend high quality webhost to host and run your jsp application: christian web host services.