Class CacheListenerAdapter<K,V>
- All Implemented Interfaces:
CacheCallback,CacheListener<K,,V> Declarable
- Direct Known Subclasses:
RegionMembershipListenerAdapter
Utility class that implements all methods in CacheListener with empty
implementations. Applications can subclass this class and only override the methods for the
events of interest.
Subclasses declared in a Cache XML file, it must also implement Declarable
- Since:
- GemFire 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafterCreate(EntryEvent<K, V> event) Handles the event of new key being added to a region.voidafterDestroy(EntryEvent<K, V> event) Handles the event of an entry being destroyed.voidafterInvalidate(EntryEvent<K, V> event) Handles the event of an entry's value being invalidated.voidafterRegionClear(RegionEvent<K, V> event) Handles the event of a region being cleared.voidafterRegionCreate(RegionEvent<K, V> event) Handles the event of a region being created.voidafterRegionDestroy(RegionEvent<K, V> event) Handles the event of a region being destroyed.voidafterRegionInvalidate(RegionEvent<K, V> event) Handles the event of a region being invalidated.voidafterRegionLive(RegionEvent<K, V> event) Handles the event of a region being live after receiving the marker from the server.voidafterUpdate(EntryEvent<K, V> event) Handles the event of an entry's value being modified in a region.voidclose()Called when the region containing this callback is closed or destroyed, when the cache is closed, or when a callback is removed from a region using anAttributesMutator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.geode.cache.Declarable
init, initialize
-
Constructor Details
-
CacheListenerAdapter
public CacheListenerAdapter()
-
-
Method Details
-
afterCreate
Description copied from interface:CacheListenerHandles the event of 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).- Specified by:
afterCreatein interfaceCacheListener<K,V> - Parameters:
event- the EntryEvent- See Also:
-
afterDestroy
Description copied from interface:CacheListenerHandles the event of an entry being destroyed.- Specified by:
afterDestroyin interfaceCacheListener<K,V> - Parameters:
event- the EntryEvent- See Also:
-
afterInvalidate
Description copied from interface:CacheListenerHandles the event of an entry's value being invalidated.- Specified by:
afterInvalidatein interfaceCacheListener<K,V> - Parameters:
event- the EntryEvent- See Also:
-
afterRegionDestroy
Description copied from interface:CacheListenerHandles 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 ownafterRegionDestroyedevent invoked on its listener.- Specified by:
afterRegionDestroyin interfaceCacheListener<K,V> - Parameters:
event- the RegionEvent- See Also:
-
afterRegionCreate
Description copied from interface:CacheListenerHandles the event of a region being created. Events are invoked for each individual region that is created.Note that this method is only called for creates done in the local vm. To be notified of creates done in remote vms use
RegionMembershipListener.afterRemoteRegionCreate(org.apache.geode.cache.RegionEvent<K, V>).- Specified by:
afterRegionCreatein interfaceCacheListener<K,V> - Parameters:
event- the RegionEvent- See Also:
-
afterRegionInvalidate
Description copied from interface:CacheListenerHandles 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 ownregionInvalidatedevent invoked on its listener.- Specified by:
afterRegionInvalidatein interfaceCacheListener<K,V> - Parameters:
event- the RegionEvent- See Also:
-
afterUpdate
Description copied from interface:CacheListenerHandles 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.- Specified by:
afterUpdatein interfaceCacheListener<K,V> - Parameters:
event- the EntryEvent- See Also:
-
afterRegionClear
Description copied from interface:CacheListenerHandles the event of a region being cleared. Events are not invoked for each individual entry that is removed as a result of the region being cleared.- Specified by:
afterRegionClearin interfaceCacheListener<K,V> - Parameters:
event- the RegionEvent- See Also:
-
afterRegionLive
Description copied from interface:CacheListenerHandles the event of a region being live after receiving the marker from the server.- Specified by:
afterRegionLivein interfaceCacheListener<K,V> - Parameters:
event- the RegionEvent- See Also:
-
close
public void close()Description copied from interface:CacheCallbackCalled when the region containing this callback is closed or destroyed, when the cache is closed, or when a callback is removed from a region using anAttributesMutator.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:
closein interfaceCacheCallback- See Also:
-