Chapter 5. Messaging 133
public void deleteListener() {
try {
MQeCommunicationsListenerAdminMsg deleteMessage =
new MQeCommunicationsListenerAdminMsg();
// set the name of the resource we wish to create
deleteMessage.setName("Listener 1");
// provide the parameters to the method that will set the action of
the
// administration message as well as the correct parameter names
using our
// input
deleteMessage.setAction(MQeAdminMsg.Action_Delete);
MQeAdminMsg response = sendMsgAndWait(deleteMessage);
if (response.getRC() != MQeAdminMsg.RC_Success) {
throw new MQeException(response.getReason());
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Adds a remote queue definition. This is used by the client to setup
* a remote queue definition to the servers local queue.
*
* @param remoteQueueManagerName
* @param queueName
*/
public void addRemoteQueueDefinition(
String remoteQueueManagerName,
String queueName) {
try {
this.remoteQueueManagerName = remoteQueueManagerName;
this.queueName = queueName;
MQeRemoteQueueAdminMsg remQueueMsg =
new MQeRemoteQueueAdminMsg(remoteQueueManagerName, queueName);
remQueueMsg.setTargetQMgr(
MQeQueueManager.getDefaultQueueManager().getName());
MQeFields parms = new MQeFields();
parms.putByte(
MQeQueueAdminMsg.Queue_Mode,
MQeQueueAdminMsg.Queue_Asynchronous);
parms.putAscii(MQeQueueAdminMsg.Queue_FileDesc, queueStore);
remQueueMsg.create(parms);
MQeAdminMsg response = sendMsgAndWait(remQueueMsg);