|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.caching.impl.CarbonCacheManager
public class CarbonCacheManager
TODO: class description
| Constructor Summary | |
|---|---|
CarbonCacheManager(String name,
CacheManagerFactoryImpl cacheManagerFactory)
|
|
| Method Summary | ||
|---|---|---|
|
createCacheBuilder(String cacheName)
Creates a new CacheBuilder for the named cache to be managed by this cache manager. |
|
boolean |
equals(Object o)
|
|
|
getCache(String cacheName)
Looks up a named cache. |
|
Iterable<Cache<?,?>> |
getCaches()
Returns an Iterable over the caches managed by this CacheManager. |
|
String |
getName()
Get the name of this cache manager |
|
int |
getOwnerTenantId()
|
|
Status |
getStatus()
Returns the status of this CacheManager. |
|
UserTransaction |
getUserTransaction()
This method will return a UserTransaction. |
|
int |
hashCode()
|
|
boolean |
isSupported(OptionalFeature optionalFeature)
Indicates whether a optional feature is supported by this CacheManager. |
|
boolean |
removeCache(String cacheName)
Remove a cache from the CacheManager. |
|
void |
shutdown()
Shuts down the CacheManager. |
|
|
unwrap(Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CarbonCacheManager(String name,
CacheManagerFactoryImpl cacheManagerFactory)
| Method Detail |
|---|
public int getOwnerTenantId()
public String getName()
CacheManager
getName in interface CacheManagerpublic Status getStatus()
CacheManager
getStatus in interface CacheManagerStatuspublic <K,V> CacheBuilder<K,V> createCacheBuilder(String cacheName)
CacheManagerCacheBuilder for the named cache to be managed by this cache manager.
An example which creates a cache using default cache configuration is:
Cache<Integer, Date> myCache2 = cacheManager.
<Integer, Date>createCacheBuilder("myCache2").
build();
An example usage which programmatically sets many parameters of CacheConfiguration,
specifies a CacheLoader and registrs listeners is:
Cache<Integer, String> myCache1 = cacheManager.
<Integer, String>createCacheBuilder("myCache1").
setCacheLoader(cl).
setStoreByValue(true).
setReadThrough(true).
setWriteThrough(false).
setStatisticsEnabled(true).
setTransactionEnabled(false).
registerCacheEntryListener(listener1, NotificationScope.LOCAL, false).
registerCacheEntryListener(listener2, NotificationScope.LOCAL, false).
build();
The returned CacheBuilder is associated with this CacheManager.
The Cache will be created, added to the caches controlled by this CacheManager and started when
CacheBuilder.build() is called.
If there is an existing Cache of the same name associated with this CacheManager when build is invoked,
an exception is thrown.
createCacheBuilder in interface CacheManagercacheName - the name of the cache to build. A cache name must consist of at least one non-whitespace character.
public <K,V> Cache<K,V> getCache(String cacheName)
CacheManager
getCache in interface CacheManagercacheName - the name of the cache to look for
public Iterable<Cache<?,?>> getCaches()
CacheManager
getCaches in interface CacheManagerpublic boolean removeCache(String cacheName)
CacheManager
removeCache in interface CacheManagercacheName - the cache name
public UserTransaction getUserTransaction()
CacheManager
getUserTransaction in interface CacheManagerpublic boolean isSupported(OptionalFeature optionalFeature)
CacheManager
isSupported in interface CacheManageroptionalFeature - the feature to check for
public void shutdown()
CacheManagerCacheLifecycle.stop()
method will be invoked, in no guaranteed order.
If the stop throws an exception, the exception is ignored.
Calls to CacheManager.getStatus() will block until shutdown completes.
On completion the CacheManager's status is changed to Status.STOPPED,
and the manager's owned caches will be empty and CacheManager.getCaches()
will return an empty collection.
A given CacheManager instance cannot be restarted after it has been stopped. A new one must be created.
shutdown in interface CacheManagerpublic <T> T unwrap(Class<T> cls)
CacheManagerIllegalArgumentException is thrown.
unwrap in interface CacheManagercls - the class of the object to be returned. This is normally either the
underlying implementation class or an interface that it implements.
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||