Design

We will put a message-driven bean (MDB) called Transfer in front of the Banking session bean (facade) as an asynchronous entry point to the same business logic (Figure 16-1).

Figure 16-1. MDB design overview

  • To let the Transfer distinguish between the different methods that it can process, we send a JMS string property along with the message.

  • For our example, we implement only the transfer method. This method requires three parameters (fromAccount, toAccount, and amount) that we package into a TransferDataObject, which is a serializable JavaBean.

  • We put the TransferDataObject into a JMS message and put the message on the queue that the ...

Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.