CacheListLoader is an abstract class. The application writer should extend
this class to handle the loading of objects into the cache. A cache list
loader can be registered for a region or group. The cache list loader
differs from the CacheLoader in that the list loader will allow multiple
objects to be loaded with a single call to the loader.
getList(java.lang.Object handle)
returns original list of objects submitted by the user
protected java.lang.Object
getNamedObject(java.lang.Object handle,
java.lang.Object name)
Returns the name of the object to be loaded
This method allows the implementor of the loadList method to iterate
through the list of Objects based on the name of the object rather
than the order the objects are in the list.
protected java.lang.Object
getNextObject(java.lang.Object handle)
returns the name of the next object in the list to be loaded
This method allows the implementor of the loadList method to iterate
through the list of Objects that need to be loaded
abstract void
loadList(java.lang.Object handle,
java.lang.Object argument)
This is an abstract method, applications should implement this
method to customize the loading of a list of cache objects.
protected void
saveObject(java.lang.Object handle,
java.lang.Object obj)
saves the given object to the cache, associating it with the current object name as set by getNextObject or getNamedObject.
protected boolean
saveObject(java.lang.Object handle,
java.lang.Object name,
java.lang.Object obj)
saves the given object to the cache, associating it with the named object.
Methods inherited from class oracle.ias.cache.CacheLoader
public abstract void loadList(java.lang.Object handle,
java.lang.Object argument)
throws CacheException
This is an abstract method, applications should implement this
method to customize the loading of a list of cache objects.
This method is called
by the caching service when any of the requested objects are not in the
cache. The getNextMethod must be used to iterate through the list to
retrieve each object to be loaded. Only the objects not already in the
cache will be loaded. The saveObject method must be used to save the
object to the cache once it is created. SaveObject will associate the
object with the current name.
Parameters:
handle - An internal handle object is passed in from cache service.
It should only be used as the first parameter of the helper methods in
this class
argument - It is an argument object for load method passed in from
customer code. This object is passed in as args either in
get(String name, Object args), or get(String name, String group,
Object args)
protected final java.lang.Object getNamedObject(java.lang.Object handle,
java.lang.Object name)
throws CacheException
Returns the name of the object to be loaded
This method allows the implementor of the loadList method to iterate
through the list of Objects based on the name of the object rather
than the order the objects are in the list. If the named object is in
the list and needs to be loaded, context is set so the next saveObject
call will associate the loaded object with the name. If the object is
not in the list or does not need to be loaded a null is returned. If
saveObject is called an InvalidOperationException will be thrown.
Parameters:
handle - An internal cache handle object, it is passed in
as the first parameter in loadList(Object handle, Object argument().
name - The name of the object to be loaded
Returns:
the name of the object to be loaded, null if the named object
is not in the list or does not need to be loaded
protected final void saveObject(java.lang.Object handle,
java.lang.Object obj)
throws CacheException
saves the given object to the cache, associating it with the current object name as set by getNextObject or getNamedObject.
This method saves the given object to the cache, associating it with the
current object name as set by getNextObject or getNamedObject. If there
is no current object name set, getNextObject or getNamedObject has not
been called, an InvalidOperationException will be thrown.
Parameters:
handle - An internal cache handle object, it is passed in
as the first parameter in loadList(Object handle, Object argument().
saves the given object to the cache, associating it with the named object.
This method saves the given object to the cache, associating it with the
named object. If the named object is not found false is returned otherwise
true is returned.
Parameters:
handle - An internal cache handle object, it is passed in
as the first parameter in loadList(Object handle, Object argument().