|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.ias.cache.CacheLoader
CacheLoader is an abstract class. Application should extend this class to handle the loading of objects into the cache. A cache loader can be registered for a region, a group or a specific object using CacheAccess object's define methods.
CacheAccess.defineRegion
,
CacheAccess.defineGroup
,
CacheAccess.defineObject
Constructor Summary |
CacheLoader()
|
Method Summary |
Type | Method |
---|---|
protected java.io.File |
createDiskObject(java.lang.Object handle)
is called from the load method to create a disk object. |
protected java.io.File |
createDiskObject(java.lang.Object handle,
Attributes attr)
is called from the load method to create a disk object. |
protected java.io.OutputStream |
createStream(java.lang.Object handle)
is called from the load method to create a streamAccessed object. |
protected java.io.OutputStream |
createStream(java.lang.Object handle,
Attributes attr)
is called from the load method to create a streamAccessed object. |
protected CacheException |
exceptionHandler(java.lang.String msg,
java.lang.Exception ex)
is called from the load method to convert any non CacheExceptions into CacheExceptions with the base exception set to the orginal exception. |
protected java.lang.Object |
getName(java.lang.Object handle)
returns the name Object for the object being loaded. |
protected java.lang.String |
getRegion(java.lang.Object handle)
returns the name of the region for the object being loaded. |
abstract java.lang.Object |
load(java.lang.Object handle,
java.lang.Object argument)
is an abstract method. |
protected void |
log(java.lang.String msg)
The log method is called from the load method to record a message in the cache's log. |
protected java.lang.Object |
netSearch(java.lang.Object handle,
int timeout)
searchs other caches for the object to be loaded. |
protected java.lang.Object |
netSearch(java.lang.Object handle,
int timeout,
boolean useRemoteTtl)
searchs other caches for the object to be loaded. |
protected void |
setAttributes(java.lang.Object handle,
Attributes attr)
sets the attributes of the object in the load method. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CacheLoader()
Method Detail |
public abstract java.lang.Object load(java.lang.Object handle, java.lang.Object argument) throws CacheException
handle
- An internal handle object is passed in from cache service.
It should only be used as the first parameter of the netSearch(handle,
timeout) or setAttributes(handle, attributes) API.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)CacheException
- if any error occurs.CacheAccess.get
protected final java.lang.Object netSearch(java.lang.Object handle, int timeout) throws CacheException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().timeout
- The time to wait for the response in milliseconds.ObjectNotFoundException
- if the object is not found or timeout.protected final java.lang.Object netSearch(java.lang.Object handle, int timeout, boolean useRemoteTtl) throws CacheException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().timeout
- The time to wait for the response in milliseconds.useRemoteTtl
- if true the idletime/ttlInterval from the
remote cache are used as the local valuesObjectNotFoundException
- if the object is not found or timeout.protected final void setAttributes(java.lang.Object handle, Attributes attr) throws CacheException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().attr
- The set of attributes to associate with the objectCacheException
- if a error occursprotected final java.lang.Object getName(java.lang.Object handle)
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().protected final java.lang.String getRegion(java.lang.Object handle)
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().protected final java.io.OutputStream createStream(java.lang.Object handle, Attributes attr) throws ObjectExistsException, DiskCacheException, CacheException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().attr
- The set of attributes to associate with the objectCacheException
- if a error occursObjectExistsException
- if the object is being or has already
been loaded by another cacheprotected final java.io.OutputStream createStream(java.lang.Object handle) throws ObjectExistsException, DiskCacheException, CacheException, java.io.IOException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().ObjectExistsException
- if the object is being or has already
been loaded by another cacheprotected final java.io.File createDiskObject(java.lang.Object handle, Attributes attr) throws ObjectExistsException, DiskCacheException, CacheException, java.io.IOException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().attr
- The set of attributes to associate with the objectCacheException
- if a error occursObjectExistsException
- if the object is being or has already
been loaded by another cacheprotected final java.io.File createDiskObject(java.lang.Object handle) throws ObjectExistsException, DiskCacheException, CacheException, java.io.IOException
handle
- An internal cache handle object, it is passed in
as the first parameter in load(Object handle, Object argument().ObjectExistsException
- if the object is being or has already
been loaded by another cacheprotected final CacheException exceptionHandler(java.lang.String msg, java.lang.Exception ex)
msg
- the message to be included with the exceptionex
- the original exceptionprotected final void log(java.lang.String msg)
msg
- the message to be logged
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |