|
Oracle Application Server 10g Java Object Cache API Reference 10g Release 2 (10.1.2) B14018-01 November 2004 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.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 | |
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 |
getFromRemote(java.lang.Object handle,
oracle.ias.cache.CacheAddress addr,
int timeout,
boolean useRemoteTtl)
searches a specific remote caches for the object to be loaded. |
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. |
protected boolean |
isRemoteRequest(java.lang.Object handle)
returns true if the load was prompted from a remote site, false otherwise If the load was triggered by a direct request from another site, this method will return true. |
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)
searches 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.
oracle.ias.cache.ObjectNotFoundException
- if the object is not found or timeout.
CacheException
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 values
oracle.ias.cache.ObjectNotFoundException
- if the object is not found or timeout.
CacheException
protected final boolean isRemoteRequest(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.Object getFromRemote(java.lang.Object handle, oracle.ias.cache.CacheAddress addr, 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 values
oracle.ias.cache.ObjectNotFoundException
- if the object is not found or timeout.
CacheException
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 object
CacheException
- 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 oracle.ias.cache.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 object
CacheException
- if a error occurs
oracle.ias.cache.ObjectExistsException
- if the object is being or has already
been loaded by another cache
DiskCacheException
protected final java.io.OutputStream createStream(java.lang.Object handle) throws oracle.ias.cache.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().
oracle.ias.cache.ObjectExistsException
- if the object is being or has already
been loaded by another cache
DiskCacheException
CacheException
java.io.IOException
protected final java.io.File createDiskObject(java.lang.Object handle, Attributes attr) throws oracle.ias.cache.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 object
CacheException
- if a error occurs
oracle.ias.cache.ObjectExistsException
- if the object is being or has already
been loaded by another cache
DiskCacheException
java.io.IOException
protected final java.io.File createDiskObject(java.lang.Object handle) throws oracle.ias.cache.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().
oracle.ias.cache.ObjectExistsException
- if the object is being or has already
been loaded by another cache
DiskCacheException
CacheException
java.io.IOException
protected final CacheException exceptionHandler(java.lang.String msg, java.lang.Exception ex)
msg
- the message to be included with the exceptionex
- the original exception
protected final void log(java.lang.String msg)
msg
- the message to be logged
|
Oracle Application Server 10g Java Object Cache API Reference 10g Release 2 (10.1.2) B14018-01 November 2004 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |