Websphere MQ Everyplace

com.ibm.mqe
Class MQeMessageEvent

java.lang.Object
  |
  +--com.ibm.mqe.MQeMessageEvent

public final class MQeMessageEvent
extends java.lang.Object

This object is passed to an application when an WebSphere MQ Everyplace message-event occurs.

This class extends the java.util.EventObject.

Example:
 // called when a msg event occurs
 public void messageArrived(MQeMessageEvent e) {
     String eventQueueName = e.getQueueName();   // get origin Q name
     String eventQMgr = e.getQueueManagerName();  // get origin QMgr
     MQeQueueManager qmgr = new MQeQueueManager();
 
     try {
         if (eventQueueName.equals("SYSTEM.DEFAULT.LOCAL.QUEUE")) {
             // get msg info
             MQeFields filter = e.getMsgFields();
 
             System.out.println("Message received from QueueMgr:" +
                 e.getQueueManagerName());
             qmgr.getMessage(null, "SYSTEM.DEFAULT.LOCAL.QUEUE", filter, null, 0);
         }
     } catch (Exception e1) {
         System.err.println("Failure ! " + e1.toString());
     }
 
 }
 
 

Constructor Summary
MQeMessageEvent(java.lang.Object source, java.lang.String eventQueueManagerName, java.lang.String eventQueueName)
          Deprecated. from version 2. Since the user cannot do anything useful with a message event, this constructor will be removed in the near future.
 
Method Summary
 MQeFields getMsgFields()
          Returns the fields object which caused the event.
 java.lang.String getQueueManagerName()
           Returns the name of the assocated Queue manager.
 java.lang.String getQueueName()
           Returns the name of the Queue on which the event occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MQeMessageEvent

public MQeMessageEvent(java.lang.Object source,
                       java.lang.String eventQueueManagerName,
                       java.lang.String eventQueueName)
Deprecated. from version 2. Since the user cannot do anything useful with a message event, this constructor will be removed in the near future.

This constructs an MQeMessageEvent object.

Parameters:
source - java.util.EventObject
eventQueueManagerName - String containing the name of the EventQMgr
eventQueueName - String containing the name of the EventQueue
Throws:
None
Method Detail

getMsgFields

public final MQeFields getMsgFields()

Returns the fields object which caused the event.

This method returns an MQeFields object containing selected fields from the message that caused the event to be generated. The UID of the message (consisting of a timestamp plus the origin queue manager name) is always returned together with the message ID, correlation ID, and message priority values if they are present in the message.

Returns:
An MQeFields object containing selected fields from the message that caused the event to be generated.
Throws:
None

getQueueManagerName

public final java.lang.String getQueueManagerName()

Returns the name of the assocated Queue manager.

This method returns a String containing the name of the queue manager that owns the queue that generated this event.

Returns:
A String containing the name of the queue manager that owns the queue that generated this event.
Throws:
None
See Also:
getQueueName

getQueueName

public final java.lang.String getQueueName()

Returns the name of the Queue on which the event occured.

This method returns a String containing the name of the queue that generated this event.

Returns:
A String containing the name of the queue owns that generated this event.
Throws:
None
See Also:
getQueueManagerName

Websphere MQ Everyplace