CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation

com.tangosol.net
Interface BackingMapManager

All Known Implementing Classes:
AbstractBackingMapManager, DefaultConfigurableCacheFactory.Manager

public interface BackingMapManager

A callback interface used by CacheService implementations. By providing a custom implementation of this interface, it is possible to use an alternative underlying store for the cached data.

A custom implementation may return a LocalCache in order to size-restrict the cache or force automatic expiry of cached data.

Currently, the "Distributed" and "Optimistic" CacheService implementations accept custom implementations of the BackingMapManager.

If the BackingMapManager object also implements XmlConfigurable interface then the XmlConfigurable.setConfig(XmlElement) method on it is called every time the configuration xml is changed by other cluster members.

Very important note: all methods of this interface are called on a thread assosiated with the corresponding CacheService and any significant delay will negatively affect the performance of this service around the cluster.

Since:
Coherence 2.0
Author:
gg 2002.09.21
See Also:
CacheFactory.getDistributedCacheService(String, BackingMapManager), CacheFactory.getOptimisticCacheService(String, BackingMapManager)

Method Summary
 BackingMapManagerContext getContext()
          Determine the current BackingMapManagerContext for this BackingMapManager.
 void init(BackingMapManagerContext context)
          Called by a CacheService to indicate to this manager that the manager is being associated with the CacheService.
 Map instantiateBackingMap(String sName)
          Instantiate a [thread safe] Map that should be used by a CacheService to store cached values for a NamedCache with the specified name.
 void releaseBackingMap(String sName, Map map)
          Release the specified Map that was created using the instantiateBackingMap(String) method.
 

Method Detail

init

void init(BackingMapManagerContext context)
Called by a CacheService to indicate to this manager that the manager is being associated with the CacheService. This method is called once immediately upon the startup of the CacheService, before any NamedCache objects are created by the CacheService.

Parameters:
context - the BackingMapManagerContext object for this BackingMapManager

getContext

BackingMapManagerContext getContext()
Determine the current BackingMapManagerContext for this BackingMapManager.

Returns:
the current context

instantiateBackingMap

Map instantiateBackingMap(String sName)
Instantiate a [thread safe] Map that should be used by a CacheService to store cached values for a NamedCache with the specified name.

If the contents of the Map can be modified by anything other than the CacheService itself (e.g. if the Map automatically expires its entries periodically or size-limits its contents), then the returned object must implement the ObservableMap interface.

Parameters:
sName - the name of the NamedCache for which this backing map is being created
Returns:
an object implementing the Map interface that will provide backing storage for the specified cache name

releaseBackingMap

void releaseBackingMap(String sName,
                       Map map)
Release the specified Map that was created using the instantiateBackingMap(String) method. This method is invoked by the CacheService when the CacheService no longer requires the specified Map object.

Parameters:
sName - the name of the NamedCache for which the specified Map object has acted as the backing map
map - the Map object that is being released

CoherenceTM v3.3
Copyright© 2000-2007 by Oracle Corporation