Exercise

To extend your knowledge of the Message-driven beans, try the following exercise.

  1. Extend the Agency case study. Add a Message-driven bean that receives a message from the AdvertiseJob Session bean when a new job is advertised. The Message-driven bean 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.

    Don't forget to create a JMS queue for the messages (you can't use the same queue as the one used in the Applicant example).

    Add some new jobs and use the TableClient program to check that rows are being added to the Matched table (this will only happen if are some applicants that match the job's location and skills).

  2. Extend your previous solution to update the Matched table when job adverts are changed. Hint: you can delete the old matched rows and add the applicants that match the new criteria rather than try to update the rows.

    For completeness you should update the Register and Agency beans so that when a job or customer is removed, all their entries in the Matched table are also removed. The Matched Entity bean has suitable home methods that support this functionality.

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

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