com.bea.cache.jcache
Interface CacheListener


public interface CacheListener

A cache listener may be registered with a Cache to listen for various events.


Method Summary
 void onClear()
          Triggered when cache is cleared due to Cache.clear()
 void onCreate(java.util.Map addedMap)
          Triggered when a cache mappings is created due to Cache.put().
 void onEvict(java.util.Map evictedMap)
          Triggered when cache keys are evicted
 void onLoad(java.util.Map loadedMap)
          Triggered when cache mappings are created due to the cache loader being consulted
 void onLoadError(java.util.Collection keys, java.lang.Throwable error)
          This method is invoked when there is an error in loading certain keys
 void onRemove(java.util.Map removedMap)
          Triggered when a cache mapping is removed due to Cache.remove()
 void onStore(java.util.Map storedMap)
          Triggered when cache keys are stored in the backing store.
 void onStoreError(java.util.Map storedMap, java.lang.Throwable problem)
          This method gets invoked when the cache is unable to write some of the key-value pairs to the backing store
 void onUpdate(java.util.Map updatedMap)
          Triggered when some cache mappings are updated due to Cache.put()
 

Method Detail

onLoad

public void onLoad(java.util.Map loadedMap)
Triggered when cache mappings are created due to the cache loader being consulted

Parameters:
loadedMap - A map of keys and values loaded by the cache loader

onLoadError

public void onLoadError(java.util.Collection keys,
                        java.lang.Throwable error)
This method is invoked when there is an error in loading certain keys

Parameters:
keys - A collection of keys that were being loaded when the problem occoured.
error - the error reported in loading the entries

onStore

public void onStore(java.util.Map storedMap)
Triggered when cache keys are stored in the backing store.

Parameters:
storedMap - A map of keys and values stored by the cache store

onStoreError

public void onStoreError(java.util.Map storedMap,
                         java.lang.Throwable problem)
This method gets invoked when the cache is unable to write some of the key-value pairs to the backing store

Parameters:
storedMap -  

onCreate

public void onCreate(java.util.Map addedMap)
Triggered when a cache mappings is created due to Cache.put(). Note that Cache.putAll() would result in multiple invocations of this method

Parameters:
addedMap - A map of single key-value pair created due to put operation

onUpdate

public void onUpdate(java.util.Map updatedMap)
Triggered when some cache mappings are updated due to Cache.put()

Parameters:
updatedMap - A map of single key-value pair. The value is the updated one.

onEvict

public void onEvict(java.util.Map evictedMap)
Triggered when cache keys are evicted

Parameters:
evictedMap - A map of key and values evicted from the cache

onRemove

public void onRemove(java.util.Map removedMap)
Triggered when a cache mapping is removed due to Cache.remove()

Parameters:
removedMap - A map of a single key-value pair removed by the remove operation

onClear

public void onClear()
Triggered when cache is cleared due to Cache.clear()


Copyright © 2007 BEA Systems All Rights Reserved.