public interface PortalCacheManager
An instance of PortalCacheManager can be injected using CDI e.g.
package demo;
import javax.inject.Inject;
import javax.enterprise.inject.Default;
import oracle.webcenter.portal.cache.PortalCacheManager;
@Default
public class Demo
{
@Inject
private PortalCacheManager mCacheManager;
// ...
}
Alternatively, the PortalCaching
class can be used to get the
instance.
Modifier and Type | Method and Description |
---|---|
<K,V> javax.cache.Cache<K,V> |
getCache(java.lang.String name)
Looks up a managed Cache given its name.
|
<K,V> javax.cache.Cache<K,V> |
getCache(java.lang.String name,
java.lang.Class<K> keyType,
java.lang.Class<V> valueType)
Looks up a managed Cache given its name.
|
<K,V> javax.cache.Cache<K,V> getCache(java.lang.String name) throws InvalidCacheNameException
This method may only be used to acquire Caches that were configured without runtime key and value types, or were configured to use Object.class key and value types.
Use the getCache(String, Class, Class)
method to acquire Caches
that were configured with specific runtime types.
Note that the name of the cache must of of the form
oracle.webcenter.*
e.g.
oracle.webcenter.portal.search
name
- the name of the managed Cache to acquireInvalidCacheNameException
- thrown if the name is invalid<K,V> javax.cache.Cache<K,V> getCache(java.lang.String name, java.lang.Class<K> keyType, java.lang.Class<V> valueType) throws InvalidCacheNameException
This method must be used for Caches that were configured with runtime key
and value types. Use getCache(String)
for Caches where these were
not specified.
Note that the name of the cache must of of the form
oracle.webcenter.*
e.g.
oracle.webcenter.portal.search
name
- the name of the managed Cache to acquirekeyType
- the expected Class of the keyvalueType
- the expected Class of the valueInvalidCacheNameException
- thrown if the name is invalid