This sample shows how message-driven beans can be used by a client application to invoke the methods of multiple session or entity beans in an asynchronous manner. Specifically, a page flow sends multiple JMS messages to various message-driven beans, which in turn create new entity bean instances or remove entity beans, a pattern known as message façade. In addition, the page flow interacts with a session bean to invoke read operations on the same entity bean, a pattern known as session façade. The combination of message façade for write operations and session façade for read operations is a common design approach in full-fledged EJB applications with asynchrony requirements.
The following EJBs are used in this sample:
For demonstration purposes a pause of 1 second is built in during the processing of a message, and the maximum number of beans instances allowed at one time for each bean is set to two.
For demonstration purposes a pause of 1 second is built in during the processing of a message, and the maximum number of beans instances allowed at one time for each bean is set to two.
In addition, the following components are used in this sample:
Note. This sample demonstrates the session and message façade pattern, and the use of JMS messages. For more detailed information on these topics, see your favorite documentation on EJB design patterns and JMS messaging.
Use of EJB controls, custom controls, and JMS controls to encapsulate business logic invoked by a page flow
Use of a page flow
The EJBs are located in the messageDriven folder of the EJBs project in the SamplesApp sample application. In the file system the location is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\EJBs\messageDriven
The page flow files that you run as a client application, the various controls used by the page flow, are located in the messageDriven folder of the EJBs_ClientApps project in the SamplesApp sample application. In the file system of the JPF controller file is:
BEA_HOME\weblogic81\samples\workshop\SamplesApp\EJBs_ClientApps\messageDriven\Controller.jpf
To Run the Sample
BEA_HOME/weblogic81/samples/workshop/startWebLogic.sh