ConsumerEvent (Eclipse OpenMQ (tm), 5.1 API Specification)
Description: declaration: package: com.sun.messaging.jms.notification, class: ConsumerEvent

Package com.sun.messaging.jms.notification

# Class ConsumerEvent

java.lang.Object
java.util.EventObject
com.sun.messaging.jms.notification.Event
com.sun.messaging.jms.notification.ConsumerEvent

All Implemented Interfaces:
  `Serializable`

public class ConsumerEvent extends Event
MQ Consumer Event.

Since:
  4.5
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONSUMER_NOT_READY`
  No consumer event code
  `static final String`
  `CONSUMER_READY`
  Consumer ready event code

  ### Fields inherited from class java.util.EventObject

  `source`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ConsumerEvent(Destination dest, Connection conn, String evCode, String evMessage)`
  Construct a MQ consumer event.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getBrokerAddress()`
  Get the broker's address that sent the event.
  `Connection`
  `getConnection()`
  Get the connection on which the event was received.
  `Destination`
  `getDestination()`
  Get the registered destination on which the event was occurred.

  ### Methods inherited from class com.sun.messaging.jms.notification.Event

  `getEventCode, getEventMessage, toString`

  ### Methods inherited from class java.util.EventObject

  `getSource`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### CONSUMER_READY

    public static final String CONSUMER_READY
    Consumer ready event code
    See Also:
      - Constant Field Values

  - ### CONSUMER_NOT_READY

    public static final String CONSUMER_NOT_READY
    No consumer event code
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ConsumerEvent

    public ConsumerEvent(Destination dest, Connection conn, String evCode, String evMessage)
    Construct a MQ consumer event.

    `dest` is the `Destination` object that was passed in `Connection.setConsumerEventListener(com.sun.messaging.Destination, com.sun.messaging.jms.notification.EventListener)` and is what will be returned by `getDestination()`

    `conn` is the `Connection` on which this event was received and is what will be returned by `getConnection()`

    `evCode` is what will be returned by `Event.getEventCode()` which can be either `CONSUMER_READY` or `CONSUMER_NOT_READY`

    `evMessage` is a description of the `evCode` and is what will be returned by `Event.getEventMessage()`

    Parameters:
      `dest` - the destination on which the event occurred.
      `conn` - the connection on which the event was received
      `evCode` - the event code that represents this event object.
      `evMessage` - the event message that describes this event object.

- ## Method Details

  - ### getConnection

    public Connection getConnection()
    Get the connection on which the event was received.
    Returns:
      the connection on which the event was received.

  - ### getBrokerAddress

    public String getBrokerAddress()
    Get the broker's address that sent the event.
    Returns:
      the broker's address that sent the event

  - ### getDestination

    public Destination getDestination()
    Get the registered destination on which the event was occurred.
    Returns:
      the registered destination on which the event was occurred.