Class AdminCacheWeakReference
- java.lang.Object
-
- com.sun.enterprise.admin.util.cache.AdminCacheWeakReference
-
- All Implemented Interfaces:
AdminCache
public class AdminCacheWeakReference extends Object implements AdminCache
AdminCache
based on week references and backgrounded byAdminCacheFileStore
layer.
Max one object representation of cached data are stored by this implementation. If different type is requested, it will be reloaded from file store usingAdminCacheFileStore
.- Author:
- mmares
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String key)
Checked if content is in the cache.<A> A
get(String key, Class<A> clazz)
Retrieve data from cache.static AdminCacheWeakReference
getInstance()
Date
lastUpdated(String key)
Date when was cached data last updated.void
put(String key, Object data)
Puts data to cache.
-
-
-
Method Detail
-
get
public <A> A get(String key, Class<A> clazz)
Description copied from interface:AdminCache
Retrieve data from cache.- Specified by:
get
in interfaceAdminCache
- Parameters:
key
- in the cacheclazz
- Cache data will be converted to requested type using appropriateAdminCacheObjectProvider
- Returns:
- Cached data converted to requested type or
null
if not cached
-
put
public void put(String key, Object data)
Description copied from interface:AdminCache
Puts data to cache.- Specified by:
put
in interfaceAdminCache
- Parameters:
key
- in the cachedata
- Cached data will be converted to raw bytes using appropriateAdminCacheObjectProvider
-
contains
public boolean contains(String key)
Description copied from interface:AdminCache
Checked if content is in the cache.- Specified by:
contains
in interfaceAdminCache
- Parameters:
key
- in the cache
-
lastUpdated
public Date lastUpdated(String key)
Description copied from interface:AdminCache
Date when was cached data last updated.- Specified by:
lastUpdated
in interfaceAdminCache
- Parameters:
key
- in the cache- Returns:
Date
of last update or null if does not exist in cache
-
getInstance
public static AdminCacheWeakReference getInstance()
-
-