public class WrapperCacheService extends WrapperService implements CacheService
CacheService.CacheActionService.MemberJoinActionm_serviceTYPE_DISTRIBUTED, TYPE_FEDERATED, TYPE_LOCAL, TYPE_OPTIMISTIC, TYPE_REMOTE, TYPE_REPLICATED| Constructor and Description |
|---|
WrapperCacheService(CacheService service)
Create a new WrapperCacheService that delegates to the given CacheService instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroyCache(NamedCache map)
Release and destroy the specified cache.
|
NamedCache |
ensureCache(String sName, ClassLoader loader)
Obtain a NamedCache interface that provides a view of resources shared among members of a cluster.
|
BackingMapManager |
getBackingMapManager()
Return a backing map manager used by this CacheService.
|
Enumeration |
getCacheNames()
Returns an Enumeration of String objects, one for each cache name that has been previously registered with this CacheService.
|
CacheService |
getCacheService()
Return the wrapped CacheService.
|
void |
releaseCache(NamedCache map)
Release local resources associated with the specified instance of the cache.
|
void |
setBackingMapManager(BackingMapManager manager)
Set a backing map manager to be used by this CacheService to create underlying stores for the cached data.
|
void |
setDependencies(ServiceDependencies deps)
Configure the Service.
|
String |
toString() |
addMemberListener, addServiceListener, configure, getCluster, getContextClassLoader, getDependencies, getInfo, getResourceRegistry, getSerializer, getService, getUserContext, isRunning, removeMemberListener, removeServiceListener, setContextClassLoader, setUserContext, shutdown, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddMemberListener, getCluster, getDependencies, getInfo, getResourceRegistry, getSerializer, getUserContext, removeMemberListener, setUserContextaddServiceListener, removeServiceListenerconfigure, isRunning, shutdown, start, stopgetContextClassLoader, setContextClassLoaderpublic WrapperCacheService(CacheService service)
service - the CacheService to wrappublic BackingMapManager getBackingMapManager()
getBackingMapManager in interface CacheServiceCacheService.setBackingMapManager(BackingMapManager)public void setBackingMapManager(BackingMapManager manager)
setBackingMapManager in interface CacheServicemanager - a backing map managerpublic NamedCache ensureCache(String sName, ClassLoader loader)
ensureCache in interface CacheServicesName - the name, within this CacheService, that uniquely identifies a view; null is legal, and may imply a default nameloader - ClassLoader that should be used to deserialize objects inserted in the map by other members of the cluster; null is legal, and implies the default ClassLoader, which will typically be the context ClassLoader for this servicepublic Enumeration getCacheNames()
getCacheNames in interface CacheServicepublic void releaseCache(NamedCache map)
CacheService.ensureCache(String, ClassLoader) method.
Releasing a Map reference to a cache makes the Map reference no longer usable, but does not affect the cache itself. In other words, all other references to the cache will still be valid, and the cache data is not affected by releasing the reference.
The reference that is released using this method can no longer be used; any attempt to use the reference will result in an exception.
The purpose for releasing a cache reference is to allow the cache implementation to release the ClassLoader used to deserialize items in the cache. The cache implementation ensures that all references to that ClassLoader are released. This implies that objects in the cache that were loaded by that ClassLoader will be re-serialized to release their hold on that ClassLoader. The result is that the ClassLoader can be garbage-collected by Java in situations where the cache is operating in an application server and applications are dynamically loaded and unloaded.
releaseCache in interface CacheServicemap - the cache object to be releasedNamedCache.release()public void destroyCache(NamedCache map)
Warning: This method is used to completely destroy the specified cache across the cluster. All references in the entire cluster to this cache will be invalidated, the cached data will be cleared, and all resources will be released.
destroyCache in interface CacheServicemap - the cache object to be releasedNamedCache.destroy()public void setDependencies(ServiceDependencies deps)
This method can only be called before the Service is started.
setDependencies in class WrapperServicedeps - the dependencies object carrying configuration information specific to this Servicepublic String toString()
toString in class WrapperServicepublic CacheService getCacheService()