ConnectionEvent (Message Queue, 5.1 API Specification)
Date: 2019-01-27

com.sun.messaging.jms.notification

## Class ConnectionEvent

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

- All Implemented Interfaces:
    java.io.Serializable
  Direct Known Subclasses:
    ConnectionClosedEvent, ConnectionClosingEvent, ConnectionReconnectedEvent, ConnectionReconnectFailedEvent

      public class ConnectionEvent
      extends Event

  MQ Connection Event. This is the super class for all MQ connection events. MQ may notify an application when a connection event is about to occur or occurred.

  The following are a list of connection notification types that defined in MQ hawk release:

  1. Connection closing in "time period":

  - SHUTDOWN (admin requested shutdown)

  2. Connection closed because of:

  - SHUTDOWN (admin requested shutdown)
  - RESTART (admin requested restart)
  - ERROR (server error, e.g. out of memory)
  - ADMIN (admin killed connection)
  - BROKER_DOWN (broker crash)

  3. Reconnected:

  - RECONNECTED to a broker

  4. Reconnect Failed:

  - RECONNECT_FAILED to a broker
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Connection` | `connection` The connection object that associated with this event.

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

      `source`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectionEvent(Connection conn, java.lang.String evCode, java.lang.String evMessage)` Construct a MQ connection event.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getBrokerAddress()` Get the broker's address that the event is associated with.
    `Connection` | `getConnection()` Get the current connection associated with this event.
    `java.lang.Object` | `getSource()` Return com.sun.messaging.jms.Connection object.

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

      `getEventCode, getEventMessage, toString`

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

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

- - ### Field Detail

    - #### connection

          protected transient Connection connection

      The connection object that associated with this event.

  - ### Constructor Detail

    - #### ConnectionEvent

          public ConnectionEvent(Connection conn,
                                 java.lang.String evCode,
                                 java.lang.String evMessage)

      Construct a MQ connection event.
      Parameters:
        `conn` - the connection associated with this event object.
        `evCode` - the event code that represents the this event object.
        `evMessage` - the event message that describes this event object.

  - ### Method Detail

    - #### getConnection

          public Connection getConnection()

      Get the current connection associated with this event.
      Returns:
        the current connection associated with this event.

    - #### getBrokerAddress

          public java.lang.String getBrokerAddress()

      Get the broker's address that the event is associated with.
      Returns:
        the broker's address that the event is associated with.

    - #### getSource

          public java.lang.Object getSource()

      Return com.sun.messaging.jms.Connection object.
      Overrides:
        `getSource` in class `java.util.EventObject`
      Returns:
        the connection object associated with this event.

Copyright (c) 2010, 2017 Oracle and/or its affiliates. All rights reserved.