org.apache.geode.cache.util

## Class CqListenerAdapter

- java.lang.Object
- - org.apache.geode.cache.util.CqListenerAdapter

- All Implemented Interfaces:
    CacheCallback, Declarable, CqListener

      public abstract class CqListenerAdapter
      extends java.lang.Object
      implements CqListener

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CqListenerAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Called when the CQ is closed, the base region is destroyed, when the cache is closed, or when this listener is removed from a CqQuery using a `CqAttributesMutator`.
    `void` | `onError(CqEvent aCqEvent)` An error occurred in the processing of a CQ.
    `void` | `onEvent(CqEvent aCqEvent)` An event occurred that modifies the results of the query.

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

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

    - ### Methods inherited from interface org.apache.geode.cache.Declarable

      `init, initialize`

- - ### Constructor Detail

    - #### CqListenerAdapter

          public CqListenerAdapter()

  - ### Method Detail

    - #### onEvent

          public void onEvent(CqEvent aCqEvent)

      An event occurred that modifies the results of the query. This event does not contain an error.
      Specified by:
        `onEvent` in interface `CqListener`
      See Also:
        `CqQuery.executeWithInitialResults()`

    - #### onError

          public void onError(CqEvent aCqEvent)

      An error occurred in the processing of a CQ. This event does contain an error. The newValue and oldValue in the event may or may not be available, and will be null if not available.
      Specified by:
        `onError` in interface `CqListener`

    - #### close

          public void close()

      Called when the CQ is closed, the base region is destroyed, when the cache is closed, or when this listener is removed from a CqQuery using a `CqAttributesMutator`.

      Implementations should cleanup any external resources such as database connections. Any runtime exceptions this method throws will be logged.

      It is possible for this method to be called multiple times on a single callback instance, so implementations must be tolerant of this.

      Specified by:
        `close` in interface `CacheCallback`
      See Also:
        `CacheCallback.close()`