Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.net
Class ExtensibleConfigurableCacheFactory.Manager

java.lang.Object
  extended by com.tangosol.util.Base
      extended by com.tangosol.net.AbstractBackingMapManager
          extended by com.tangosol.net.ExtensibleConfigurableCacheFactory.Manager

All Implemented Interfaces:
BackingMapManager
Direct Known Subclasses:
TransactionalScheme.Manager
Enclosing class:
ExtensibleConfigurableCacheFactory

public static class ExtensibleConfigurableCacheFactory.Manager
extends AbstractBackingMapManager

The Manager class uses builders to create the required backing maps and provides client access to those maps.

This class also implements methods to create/release backup maps as needed by PartitionedCache$Storage$BackingManager.


Constructor Summary
ExtensibleConfigurableCacheFactory.Manager(ExtensibleConfigurableCacheFactory factory)
          Construct the backing map manager.

 

Method Summary
protected  CachingScheme findCachingScheme(java.lang.String sName)
          Return the CachingScheme for a given cache name.
protected  DistributedScheme findDistributedScheme(java.lang.String sName)
          Return the DistributedScheme for a given cache name.
 java.util.Map getBackingMap(java.lang.String sName)
          Get the backing Map associated with a given cache.
 ExtensibleConfigurableCacheFactory getCacheFactory()
          Obtain the "container" ConfigurableCacheFactory that created this manager and which this manager is bound to.
protected  com.tangosol.config.expression.ScopedParameterResolver getResolver(java.lang.String sName)
          Return the ScopedParameterResolver for the given cache.
 void init(BackingMapManagerContext context)
          Called by a CacheService to indicate to this manager that the manager is being associated with the CacheService.
 java.util.Map instantiateBackingMap(java.lang.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.
 java.util.Map instantiateBackupMap(java.lang.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.
protected  java.util.Map instantiatePartitionedBackingMap(MapBuilder bldrMap, com.tangosol.config.expression.ParameterResolver resolver, MapBuilder.Dependencies dependencies, CachingScheme scheme)
          Instantiate a partitioned backing map (an instance of ObservableSplittingBackingMap) using ExtensibleConfigurableCacheFactory.PartitionedBackingMapManager.
 boolean isBackupPartitioned(java.lang.String sName)
          Return true if the map should be partitioned.
 void releaseBackingMap(java.lang.String sName, java.util.Map map)
          Release the specified Map that was created using the AbstractBackingMapManager.instantiateBackingMap(String) method.
 void releaseBackupMap(java.lang.String sName, java.util.Map map, java.util.Map mapListeners)
          Release the specified Map that was created using the instantiateBackupMap(String) method.
protected  void setBackingMap(java.lang.String sName, java.util.Map map)
          Associate the specified backing Map with a given name.

 

Methods inherited from class com.tangosol.net.AbstractBackingMapManager
getContext

 

Constructor Detail

ExtensibleConfigurableCacheFactory.Manager

public ExtensibleConfigurableCacheFactory.Manager(ExtensibleConfigurableCacheFactory factory)
Construct the backing map manager.
Parameters:
factory - the factory associated with this manager

Method Detail

init

public 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.

Important note: BackingMapManager cannot be associated with more then one instance of a CacheService. However, in a situation when a CacheService automatically restarts, it is possible that this manager instance is re-used by a newly created (restarted) CacheService calling this method once again providing a new context.

Important note: BackingMapManager cannot be associated with more than one instance of a CacheService. However, in a situation when a CacheService automatically restarts, it is possible that this manager instance is re-used by a newly created (restarted) CacheService calling this method once again providing a new context.

Specified by:
init in interface BackingMapManager
Overrides:
init in class AbstractBackingMapManager
Parameters:
context - the BackingMapManagerContext object for this BackingMapManager

instantiateBackingMap

public java.util.Map instantiateBackingMap(java.lang.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.

Specified by:
instantiateBackingMap in interface BackingMapManager
Specified by:
instantiateBackingMap in class AbstractBackingMapManager
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

instantiatePartitionedBackingMap

protected java.util.Map instantiatePartitionedBackingMap(MapBuilder bldrMap,
                                                         com.tangosol.config.expression.ParameterResolver resolver,
                                                         MapBuilder.Dependencies dependencies,
                                                         CachingScheme scheme)
Instantiate a partitioned backing map (an instance of ObservableSplittingBackingMap) using ExtensibleConfigurableCacheFactory.PartitionedBackingMapManager. If the provided scheme is an instance of ReadWriteBackingMapScheme, the internal scheme's map builder is used to build the backing map.
Parameters:
bldrMap - the MapBuilder for partitions
resolver - the ParameterizedBuilder
dependencies - the ExtensibleConfigurableCacheFactory.Dependencies for MapBuilders
scheme - the CachingScheme of the requested cache
Returns:
partitioned backing map that will provide backing storage for the specified cache

releaseBackingMap

public void releaseBackingMap(java.lang.String sName,
                              java.util.Map map)
Release the specified Map that was created using the AbstractBackingMapManager.instantiateBackingMap(String) method. This method is invoked by the CacheService when the CacheService no longer requires the specified Map object.
Specified by:
releaseBackingMap in interface BackingMapManager
Overrides:
releaseBackingMap in class AbstractBackingMapManager
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

instantiateBackupMap

public java.util.Map instantiateBackupMap(java.lang.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.
Parameters:
sName - the name of the NamedCache for which this map is being created
Returns:
an object implementing the Map interface that will provide backing storage for the specified cache name

releaseBackupMap

public void releaseBackupMap(java.lang.String sName,
                             java.util.Map map,
                             java.util.Map mapListeners)
Release the specified Map that was created using the instantiateBackupMap(String) method. This method is invoked by the CacheService when the CacheService no longer requires the specified Map object.
Parameters:
sName - the cache name
map - the Map object that is being released
mapListeners - the map of listeners for the map

isBackupPartitioned

public boolean isBackupPartitioned(java.lang.String sName)
Return true if the map should be partitioned.
Parameters:
sName - the cache name
Returns:
true if the backup map should be partitioned

getCacheFactory

public ExtensibleConfigurableCacheFactory getCacheFactory()
Obtain the "container" ConfigurableCacheFactory that created this manager and which this manager is bound to.
Returns:
the ConfigurableCacheFactory that created this manager

getResolver

protected com.tangosol.config.expression.ScopedParameterResolver getResolver(java.lang.String sName)
Return the ScopedParameterResolver for the given cache. A scoped resolver is needed so that a sub-class (like TransactionScheme.Manager) can add a parameter to the resolver.
Parameters:
sName - the cache name
Returns:
the ScopedParameterResolver

getBackingMap

public java.util.Map getBackingMap(java.lang.String sName)
Get the backing Map associated with a given cache.
Parameters:
sName - the cache name
Returns:
a Map associated with the specified name

setBackingMap

protected void setBackingMap(java.lang.String sName,
                             java.util.Map map)
Associate the specified backing Map with a given name.
Parameters:
sName - the cache name
map - the backing map associated with the specified name

findDistributedScheme

protected DistributedScheme findDistributedScheme(java.lang.String sName)
Return the DistributedScheme for a given cache name.
Parameters:
sName - the cache name
Returns:
the DistributedScheme or null

findCachingScheme

protected CachingScheme findCachingScheme(java.lang.String sName)
Return the CachingScheme for a given cache name. If the caching scheme is a near cache then return the back scheme.
Parameters:
sName - the cache name
Returns:
the CachingScheme or null

Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.