public final class CacheFactory extends Object
Cache
instance and to register the CacheProvider
that is used to obtain that.Modifier and Type | Field and Description |
---|---|
static String |
CACHE_PROVIDER_PARAM_NAME |
Modifier and Type | Method and Description |
---|---|
static Cache |
getCache(FacesContext context,
String scope)
Gets an instance of a Cache using the configured cache provider.
|
static CacheProvider |
getCacheProvider(FacesContext context)
Gets the cache provider that has been set, or the default provider if none is present.
|
static CacheProvider |
getCacheProvider(ServletContext servletContext)
Gets the cache provider as it has been set in the ServletContext.
|
static CacheProvider |
getDefaultCacheProvider()
Returns an instance of the default cache provider.
|
static void |
setCacheProvider(CacheProvider cacheProvider,
ServletContext servletContext) |
public static final String CACHE_PROVIDER_PARAM_NAME
public static Cache getCache(FacesContext context, String scope)
context
- faces context used for retrieving the cache provider and for resolving the given scope.scope
- scope for which the cache should be obtained. Supported scopes are dependent on the specific caching
provider, but generally at least "session" and "application" should be supported.public static CacheProvider getCacheProvider(ServletContext servletContext)
servletContext
- the servlet context where the cache provider is retrieved frompublic static void setCacheProvider(CacheProvider cacheProvider, ServletContext servletContext)
public static CacheProvider getCacheProvider(FacesContext context)
context
- the faces context where the cache provider is retrieved frompublic static CacheProvider getDefaultCacheProvider()
getCache(FacesContext, String)
and getCacheProvider(FacesContext)
if no
explicit provider has been set.Copyright © 2012–2021 OmniFaces. All rights reserved.