Event Handling APIs
Code your event handlers to do minimal work before returning control to GemFire.
For example, a listener implementation may hand off the event to a thread pool that processes the event on its thread rather than the listener thread. Exceptions thrown by the listeners are caught by GemFire and logged.
- RegionEvent class. Provides information about the event, such as what region the event originated in, whether the event originated in a cache remote to the event handler, and whether the event resulted from a distributed operation.
- EntryEvent class. Provides all available information for the
RegionEvent
. It also provides entry-specific information, such as the old and new entry values and whether the event resulted from a load operation. - ICacheLoader application callback interface. Loads data into a region.
- ICacheWriter application callback interface. Synchronously handles region and entry events before the events occur. Entry events are
create
,update
,invalidate
, anddestroy
. Region events are invalidate and destroy. This class has the ability to abort events. - ICacheListener application callback interface. Asynchronously handles region and entry events. Listeners receive notifications when entries in a region change, or when changes occur to the region attributes themselves. Entry events are
create
,update
,invalidate
, anddestroy
. Region events areinvalidate
anddestroy
. Multiple events can cause concurrent invocation ofICacheListener
methods. If event A occurs before event B, there is no guarantee that their corresponding ICacheListener method invocations will occur in the same order.