|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jcs.access.CacheAccess
Class which provides interface for all access to the cache. An instance of this class is tied to a specific cache region. Static methods are provided to get such instances.
Field Summary | |
protected CompositeCache |
cacheControl
Cache that a given instance of this class provides access to. |
private static CompositeCacheManager |
cacheMgr
Cache manager use by the various forms of defineRegion and getAccess |
private static org.apache.commons.logging.Log |
log
|
Constructor Summary | |
CacheAccess(CompositeCache cacheControl)
Constructor for the CacheAccess object. |
Method Summary | |
static CacheAccess |
defineRegion(java.lang.String name)
Define a new cache region with the given name. |
static CacheAccess |
defineRegion(java.lang.String name,
CompositeCacheAttributes cattr)
Define a new cache region with the specified name and attributes. |
static CacheAccess |
defineRegion(java.lang.String name,
CompositeCacheAttributes cattr,
IElementAttributes attr)
Define a new cache region with the specified name and attributes and return a CacheAccess to it. |
void |
destroy()
Deprecated. |
void |
destroy(java.lang.Object name)
Deprecated. use remove |
protected void |
dispose()
Dispose this region. |
protected static void |
ensureCacheManager()
Helper method which checks to make sure the cacheMgr class field is set, and if not requests an instance from CacheManagerFactory. |
java.lang.Object |
get(java.lang.Object name)
Retrieve an object from the cache region this instance provides access to. |
static CacheAccess |
getAccess(java.lang.String region)
Get a CacheAccess instance for the given region. |
static CacheAccess |
getAccess(java.lang.String region,
ICompositeCacheAttributes icca)
Get a CacheAccess instance for the given region with the given attributes. |
ICompositeCacheAttributes |
getCacheAttributes()
Gets the ICompositeCacheAttributes of the cache region |
IElementAttributes |
getElementAttributes()
GetElementAttributes will return an attribute object describing the current attributes associated with the object name. |
IElementAttributes |
getElementAttributes(java.lang.Object name)
GetElementAttributes will return an attribute object describing the current attributes associated with the object name. |
void |
put(java.lang.Object name,
java.lang.Object obj)
Place a new object in the cache, associated with key name. |
void |
put(java.lang.Object key,
java.lang.Object val,
IElementAttributes attr)
Place a new object in the cache. |
void |
putSafe(java.lang.Object key,
java.lang.Object value)
Place a new object in the cache, associated with key name. |
void |
remove()
Description of the Method |
void |
remove(java.lang.Object name)
Description of the Method |
void |
resetElementAttributes(IElementAttributes attr)
ResetAttributes allows for some of the attributes of a region to be reset in particular expiration time attriubtes, time to live, default time to live and idle time, and event handlers. |
void |
resetElementAttributes(java.lang.Object name,
IElementAttributes attr)
Reset attributes for a particular element in the cache. |
void |
save()
If there are any auxiliary caches associated with this cache, save all objects to them. |
void |
setCacheAttributes(ICompositeCacheAttributes cattr)
Sets the ICompositeCacheAttributes of the cache region. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final org.apache.commons.logging.Log log
private static CompositeCacheManager cacheMgr
protected CompositeCache cacheControl
Constructor Detail |
public CacheAccess(CompositeCache cacheControl)
cacheControl
- The cache which the created instance accessesMethod Detail |
public static CacheAccess defineRegion(java.lang.String name) throws CacheException
name
- Name that will identify the region
CacheException
public static CacheAccess defineRegion(java.lang.String name, CompositeCacheAttributes cattr) throws CacheException
name
- Name that will identify the regioncattr
- CompositeCacheAttributes for the region
CacheException
public static CacheAccess defineRegion(java.lang.String name, CompositeCacheAttributes cattr, IElementAttributes attr) throws CacheException
name
- Name that will identify the regioncattr
- CompositeCacheAttributes for the regionattr
- Attributes for the region
CacheException
public static CacheAccess getAccess(java.lang.String region) throws CacheException
region
- Name that identifies the region
CacheException
public static CacheAccess getAccess(java.lang.String region, ICompositeCacheAttributes icca) throws CacheException
region
- Name that identifies the regionicca
-
CacheException
protected static void ensureCacheManager()
public java.lang.Object get(java.lang.Object name)
get
in interface ICacheAccess
name
- Key the object is stored as
public void putSafe(java.lang.Object key, java.lang.Object value) throws CacheException
putSafe
in interface ICacheAccess
key
- Key object will be stored withvalue
- Object to store
CacheException
public void put(java.lang.Object name, java.lang.Object obj) throws CacheException
put
in interface ICacheAccess
name
- Key object will be stored withobj
- Object to store
CacheException
public void put(java.lang.Object key, java.lang.Object val, IElementAttributes attr) throws CacheException
put
in interface ICacheAccess
CacheException
public void destroy() throws CacheException
destroy
in interface ICacheAccess
CacheException
ICacheAccess.remove()
public void remove() throws CacheException
remove
in interface ICacheAccess
CacheException
public void destroy(java.lang.Object name) throws CacheException
destroy
in interface ICacheAccess
name
- Key that specifies object to invalidate
CacheException
ICacheAccess.remove()
public void remove(java.lang.Object name) throws CacheException
remove
in interface ICacheAccess
CacheException
public void save()
public void resetElementAttributes(IElementAttributes attr) throws CacheException, InvalidHandleException
resetElementAttributes
in interface ICacheAccess
attr
- New attributes for this region.
CacheException
InvalidHandleException
public void resetElementAttributes(java.lang.Object name, IElementAttributes attr) throws CacheException, InvalidHandleException
resetElementAttributes
in interface ICacheAccess
name
- Key of object to reset attributes forattr
- New attributes for the object
CacheException
InvalidHandleException
public IElementAttributes getElementAttributes() throws CacheException
getElementAttributes
in interface ICacheAccess
CacheException
public IElementAttributes getElementAttributes(java.lang.Object name) throws CacheException
getElementAttributes
in interface ICacheAccess
name
- Key of object to get attributes for
CacheException
protected void dispose()
public ICompositeCacheAttributes getCacheAttributes()
getCacheAttributes
in interface ICacheAccess
public void setCacheAttributes(ICompositeCacheAttributes cattr)
setCacheAttributes
in interface ICacheAccess
cattr
- The new ICompositeCacheAttribute value
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |