Chapter 5. Messaging 127
This code unregisters the service when the bundle stops.
24.Organize Imports and save the file.
25.From the Package Explorer tab of the SMF Perspective, select the
ITSORentalsDatabaseServiceBundle Project you created and expand it
down to the file META-INF/MANIFEST.MF. Double-click the file name
MANIFEST.MF.
26.This opens the MANIFEST.MF editor. Scroll down to Export Packages.
27.Expand the section Export Packages and select Add...
28.Select the package com.itso.rentals.mqe and click OK.
29.Scroll down to Export Services and select Add...
30.Select the service com.itso.rentals.mqe.ITSORentalsMQeService and
click OK.
31.Scroll down to Import Services.
32.Expand the section Import Services and select Add...
33.Select the service
com.itso.rentals.database.ITSORentalsDatabaseService and click OK.
34.Save the file.
5.3.3 Creating the MQeAdmin Class
The MQeAdmin class is required for both the client side and the MQe server side
implementation. The MQeAdmin class contains a number of utility methods to
access and manipulate queue managers and queues.
1. Create the MQeAdmin class in the same package as above. Insert the
following code in Example 5-3 into the class file:
Example 5-3 MQeAdmin class code
/**
* MQeAdmin class provides helper methods to create and configure
* an MQeQueueManager.
*
* The QM name and Reg location to be used are passed in via
* the constructor.
*
* This class configures QueueManagers to use the following adapters:
* MQeTcpipHttpAdapter is used for comms.
* MQeDiskFieldsAdapter is used for registry storage.
*