org.jboss.seam.cache
public abstract class CacheProvider<T> extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_REGION
the region name to be used if no region is specified
|
Constructor and Description |
---|
CacheProvider() |
Modifier and Type | Method and Description |
---|---|
abstract void |
clear()
Removes all objects from all cache regions
|
Object |
get(String key)
Fetches an object for the given key from the cache and returns it if
found.
|
<E> E |
get(String key,
E type)
Fetches an object for the given key from the cache and returns it if
found.
|
abstract Object |
get(String region,
String key)
Fetches an object for the given key from the cache and returns it if
found.
|
<E> E |
get(String region,
String key,
E type)
Fetches an object for the given key from the cache and returns it if
found.
|
String |
getConfiguration()
Get the configuration file used by the cache
|
protected InputStream |
getConfigurationAsStream() |
String |
getDefaultRegion() |
abstract T |
getDelegate() |
static CacheProvider |
instance() |
static <T> CacheProvider<T> |
instance(Class<? extends T> type) |
void |
put(String key,
Object object)
Put an object into the cache.
|
abstract void |
put(String region,
String key,
Object object)
Puts an object into the cache.
|
void |
remove(String key)
Removes an object from the cache.
|
abstract void |
remove(String region,
String key)
Removes an object from the cache.
|
void |
setConfiguration(String cfgResourceName)
Set the configuration file to be used by the cache
|
void |
setDefaultRegion(String defaultRegion) |
public static final String DEFAULT_REGION
public abstract T getDelegate()
public String getConfiguration()
protected InputStream getConfigurationAsStream()
public void setConfiguration(String cfgResourceName)
public Object get(String key)
key
- - a key to identify the object.public <E> E get(String key, E type)
key
- - a key to identify the object.type
- - the type of the object to returnpublic abstract Object get(String region, String key)
region
- - the name of a cache regionkey
- - a key to identify the object.public <E> E get(String region, String key, E type)
region
- - the name of a cache regionkey
- - a key to identify the object.type
- - the type of object to returnpublic void put(String key, Object object)
key
- - a key to identify the objectobject
- - the object to be stored in the cachepublic abstract void put(String region, String key, Object object)
region
- - the name of a cache regionkey
- - a key to identify the objectobject
- - the object to be stored in the cachepublic void remove(String key)
key
- - a key to identify the objectpublic abstract void remove(String region, String key)
region
- - the name of a cache regionkey
- - a key to identify the objectpublic abstract void clear()
public String getDefaultRegion()
public void setDefaultRegion(String defaultRegion)
public static CacheProvider instance()
public static <T> CacheProvider<T> instance(Class<? extends T> type)
Copyright © 2015 Seam Framework. All Rights Reserved.