CqListenerAdapter (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache.util, class: CqListenerAdapter

Package 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 Object implements CqListener

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CqListenerAdapter()`

- ## Method Summary

  Modifier and Type
  Method
  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 Details

  - ### CqListenerAdapter

    public CqListenerAdapter()

- ## Method Details

  - ### 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`
    Parameters:
      `aCqEvent` - the `CqEvent` that triggered the listener
    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`
    Parameters:
      `aCqEvent` - the `CqEvent` which encountered the error

  - ### 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()`