Exercise

To extend your knowledge of MDBs, try the following exercise.

  1. Extend the Agency case study. Add an MDB called JobMatch that receives a messages from the Advertise and AdvertiseJob Session beans when a job is created, deleted or modified. The MDB should search through all the applicants to find those suitable to be considered for the job. To be considered for a job, the applicant must match the job's:

    • Location

    • At least one skill

    If the applicant has all the required skills, set exactMatch to true; otherwise, false.

    All applicants that match at least one skill must be added to the Matched table. Use the message queue jms/jobMatch for your enhancements because you cannot use the same queue as the one used in the Applicant example. This queue is created by the asant create-jms command you ran at the start of the examples.

    Use the code shown in today's example as a guide to your new code. In particular you should:

    • Add a sendJob() method to the MessageSender helper class to put messages on the jms/jobMatch queue

    • Update the Advertise.createJob() and Advertise.deleteJob() methods to use the MessageSender helper class

    • Update the AdvertiseJob.UpdateDetails() method to use the MessageSender helper class

    • Add the Connection Factory and JMS destination resources to the Advertise and AdvertiseJob Session bean deployment descriptors.

A solution for this exercise is provided in the agency directory of Day 10 on the Web site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.29.119