VMware Tanzu GemFire .NET Client API Reference
An application plug-in that can be installed on a region. More...
Public Member Functions | |
| void | AfterCreate (IEntryEvent< TKey, TValue > ev) |
| Handles the event of a new key being added to a region. More... | |
| void | AfterUpdate (IEntryEvent< TKey, TValue > ev) |
| Handles the event of an entry's value being modified in a region. More... | |
| void | AfterInvalidate (IEntryEvent< TKey, TValue > ev) |
| Handles the event of an entry's value being invalidated. More... | |
| void | AfterDestroy (IEntryEvent< TKey, TValue > ev) |
| Handles the event of an entry being destroyed. More... | |
| void | AfterRegionClear (IRegionEvent< TKey, TValue > ev) |
| Handles the event of a region being cleared. More... | |
| void | AfterRegionInvalidate (IRegionEvent< TKey, TValue > ev) |
| Handles the event of a region being invalidated. More... | |
| void | AfterRegionDestroy (IRegionEvent< TKey, TValue > ev) |
| Handles the event of a region being destroyed. More... | |
| void | AfterRegionLive (IRegionEvent< TKey, TValue > ev) |
| Handles the event of a region going live. More... | |
Detailed Description
An application plug-in that can be installed on a region.
Listeners are change notifications that are invoked AFTER the change has occured for region update operations on a client. Listeners also receive notifications when entries in a region are modified. Multiple events can cause concurrent invocation of ICacheListener methods. If event A occurs before event B, there is no guarantee that their corresponding ICacheListener method invocations will occur in the same order. Any exceptions thrown by the listener are caught by GemFire and logged. If the exception is for a notification received from server then that is logged and the notification thread moves on to receiving other notifications.
There are two cases in which listeners are invoked. The first is when a region modification operation (e.g. put, create, destroy, invalidate) is performed. For this case it is important to ensure that minimal work is done in the listener before returning control back to GemFire since the operation will block till the listener has not completed. For example, a listener implementation may choose to hand off the event to a thread pool that then processes the event on its thread rather than the listener thread. The second is when notifications are received from java server as a result of region register interest calls (Region.RegisterKeys etc), or invalidate notifications when notify-by-subscription is false on the server. In this case the methods of ICacheListener are invoked asynchronously (i.e. does not block the thread that receives notification messages). Additionally for the latter case of notifications from server, listener is always invoked whether or not local operation is successful e.g. if a destroy notification is received and key does not exist in the region, the listener will still be invoked. This is different from the first case where listeners are invoked only when the region update operation succeeds.
- See also
- IRegionFactory.SetCacheListener
Member Function Documentation
◆ AfterCreate()
| void ICacheListener< TKey, TValue >.AfterCreate | ( | IEntryEvent< TKey, TValue > | ev | ) |
Handles the event of a new key being added to a region.
The entry did not previously exist in this region in the local cache (even with a null value).
This function does not throw any exception.
- Parameters
-
ev Denotes the event object associated with the entry creation.
◆ AfterDestroy()
| void ICacheListener< TKey, TValue >.AfterDestroy | ( | IEntryEvent< TKey, TValue > | ev | ) |
Handles the event of an entry being destroyed.
- Parameters
-
ev EntryEvent denotes the event object associated with the entry destruction.
◆ AfterInvalidate()
| void ICacheListener< TKey, TValue >.AfterInvalidate | ( | IEntryEvent< TKey, TValue > | ev | ) |
Handles the event of an entry's value being invalidated.
- Parameters
-
ev EntryEvent denotes the event object associated with the entry invalidation.
◆ AfterRegionClear()
| void ICacheListener< TKey, TValue >.AfterRegionClear | ( | IRegionEvent< TKey, TValue > | ev | ) |
Handles the event of a region being cleared.
◆ AfterRegionDestroy()
| void ICacheListener< TKey, TValue >.AfterRegionDestroy | ( | IRegionEvent< TKey, TValue > | ev | ) |
Handles the event of a region being destroyed.
Events are not invoked for each individual entry that is destroyed as a result of the region being destroyed. Each subregion, however, gets its own AfterRegionDestroyed event invoked on its listener.
- Parameters
-
ev RegionEvent denotes the event object associated with the region destruction.
◆ AfterRegionInvalidate()
| void ICacheListener< TKey, TValue >.AfterRegionInvalidate | ( | IRegionEvent< TKey, TValue > | ev | ) |
Handles the event of a region being invalidated.
Events are not invoked for each individual value that is invalidated as a result of the region being invalidated. Each subregion, however, gets its own RegionInvalidated event invoked on its listener.
- Parameters
-
ev RegionEvent denotes the event object associated with the region invalidation.
◆ AfterRegionLive()
| void ICacheListener< TKey, TValue >.AfterRegionLive | ( | IRegionEvent< TKey, TValue > | ev | ) |
Handles the event of a region going live.
Each subregion gets its own AfterRegionLive event invoked on its listener.
- Parameters
-
ev RegionEvent denotes the event object associated with the region going live.
- See also
- ICache.ReadyForEvents
◆ AfterUpdate()
| void ICacheListener< TKey, TValue >.AfterUpdate | ( | IEntryEvent< TKey, TValue > | ev | ) |
Handles the event of an entry's value being modified in a region.
This entry previously existed in this region in the local cache, but its previous value may have been null.
- Parameters
-
ev EntryEvent denotes the event object associated with updating the entry.
The documentation for this interface was generated from the following file:
- gemfire.client/Interfaces/ICacheListener.cs

