Java Reference
In-Depth Information
Figure 5-3. Class diagram: Spring MDB support
Listing 5-20 shows the MDB used in the eInsure reporting subsystem. MDB develop-
ment is less cumbersome compared to SLSB because you don't have home and remote
interfaces.
Listing 5-20. ReportingMDB.java
public class ReportingMDB extends AbstractJmsMessageDrivenBean {
protected void onEjbCreate() {
//initialize application service components from Spring bean factory
}
public void onMessage(Message msg) {
//handle business request here - report generations
}
}
Figure 5-4 shows the message sequence of message flow as the EJB container invokes
the MDB. The client that triggered the asynchronous processing returns just after send-
ing the message to the queue. Once the message arrives in a queue, the EJB container
delegates the processing to an MDB instance by invoking the onMessage method. This
method can be utilized to invoke a POJO service component for report generation.
 
Search WWH ::




Custom Search