Class AbstractCachingScheme<D extends ServiceDependencies>
- java.lang.Object
-
- com.tangosol.coherence.config.scheme.AbstractScheme
-
- com.tangosol.coherence.config.scheme.AbstractServiceScheme<D>
-
- com.tangosol.coherence.config.scheme.AbstractCachingScheme<D>
-
- All Implemented Interfaces:
BackingMapManagerBuilder
,MapBuilder
,NamedCacheBuilder
,ServiceBuilder
,CachingScheme
,ObservableCachingScheme
,Scheme
,ServiceScheme
- Direct Known Subclasses:
AbstractLocalCachingScheme
,BaseGrpcScheme
,DistributedScheme
,ProxyScheme
,RemoteCacheScheme
,ReplicatedScheme
,TransactionalScheme
public abstract class AbstractCachingScheme<D extends ServiceDependencies> extends AbstractServiceScheme<D> implements ObservableCachingScheme
AnAbstractCachingScheme
is a base implementation for anCachingScheme
.- Since:
- Coherence 12.1.2
- Author:
- pfm 2011.12.28
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.MapBuilder
MapBuilder.Dependencies
-
-
Field Summary
-
Fields inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
m_serviceDependencies
-
Fields inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
DELIM_APPLICATION_SCOPE, DELIM_DOMAIN_PARTITION
-
-
Constructor Summary
Constructors Constructor Description AbstractCachingScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
establishMapListeners(Map map, ParameterResolver resolver, MapBuilder.Dependencies dependencies)
Establishes an appropriateMapListener
(provided by theObservableCachingScheme.getListenerBuilder()
) on theObservableMap
that was produced by theObservableCachingScheme
.ParameterResolver
getDefaultParameterResolver()
Obtains the ParameterResolver to use when resolving parameters without one being available in a context.ParameterizedBuilder<MapListener>
getListenerBuilder()
Obtains aParameterizedBuilder
for aMapListener
that can be used for buildingMapListener
s those of which may be later added to theMap
s orNamedCache
s realized by theCachingScheme
.BackingMapManager
realizeBackingMapManager(ConfigurableCacheFactory ccf)
Realize aBackingMapManager
to be scoped by the specifiedConfigurableCacheFactory
.NamedCache
realizeCache(ParameterResolver resolver, MapBuilder.Dependencies dependencies)
Realizes aNamedCache
(possibly "ensuring it") based on the state of the builder, the providedParameterResolver
andMapBuilder
dependencies.Map
realizeMap(ParameterResolver resolver, MapBuilder.Dependencies dependencies)
Realize aMap
based on the state of theMapBuilder
, resolvable parameters and providedMapBuilder.Dependencies
.void
setListenerBuilder(ParameterizedBuilder<MapListener> bldr)
Set theParameterizedBuilder
that builds aMapListener
.protected void
validate(ParameterResolver resolver)
Validate the properties.-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
ensureService, getDefaultServiceName, getEventInterceptorBuilders, getScopedServiceName, getScopeName, getServiceBuilder, getServiceDependencies, getServiceName, getXml, injectScopeNameIntoService, isAutoStart, isRunningClusterNeeded, realizeService, setAutoStart, setScopeName, setServiceDependencies, setServiceName, setXml
-
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeName, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tangosol.coherence.config.scheme.Scheme
getSchemeName, isAnonymous
-
Methods inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
getEventInterceptorBuilders, getScopedServiceName, getServiceBuilder, getServiceName, getServiceType, isAutoStart
-
-
-
-
Method Detail
-
realizeCache
public NamedCache realizeCache(ParameterResolver resolver, MapBuilder.Dependencies dependencies)
Realizes aNamedCache
(possibly "ensuring it") based on the state of the builder, the providedParameterResolver
andMapBuilder
dependencies.The
MapBuilder
dependencies are required to satisfy the requirement when realizing aNamedCache
additionally involves realizing one or more internalMap
s.- Specified by:
realizeCache
in interfaceNamedCacheBuilder
- Parameters:
resolver
- the ParameterResolverdependencies
- theMapBuilder
dependencies- Returns:
- a
NamedCache
-
realizeMap
public Map realizeMap(ParameterResolver resolver, MapBuilder.Dependencies dependencies)
Realize aMap
based on the state of theMapBuilder
, resolvable parameters and providedMapBuilder.Dependencies
.- Specified by:
realizeMap
in interfaceMapBuilder
- Parameters:
resolver
- theParameterResolver
dependencies
- theMapBuilder.Dependencies
for realizing theMap
- Returns:
- a
Map
-
realizeBackingMapManager
public BackingMapManager realizeBackingMapManager(ConfigurableCacheFactory ccf)
Realize aBackingMapManager
to be scoped by the specifiedConfigurableCacheFactory
.- Specified by:
realizeBackingMapManager
in interfaceBackingMapManagerBuilder
- Parameters:
ccf
- theConfigurableCacheFactory
- Returns:
- a
BackingMapManager
-
getListenerBuilder
public ParameterizedBuilder<MapListener> getListenerBuilder()
Obtains aParameterizedBuilder
for aMapListener
that can be used for buildingMapListener
s those of which may be later added to theMap
s orNamedCache
s realized by theCachingScheme
.- Specified by:
getListenerBuilder
in interfaceObservableCachingScheme
- Returns:
- a
ParameterizedBuilder
forMapListener
s
-
establishMapListeners
public void establishMapListeners(Map map, ParameterResolver resolver, MapBuilder.Dependencies dependencies)
Establishes an appropriateMapListener
(provided by theObservableCachingScheme.getListenerBuilder()
) on theObservableMap
that was produced by theObservableCachingScheme
.This method will automatically inject the following types and named values into realized classes that have been annotated with @Injectable.
-
BackingMapManagerContext
(optionally named "manager-context") -
ConfigurableCacheFactory
- Cache Name (as a
String
.class named "cache-name") - Context
ClassLoader
(optionally named "class-loader") -
ResourceRegistry
-
CacheConfig
- together with any other resource, named or otherwise, available
in the
ResourceRegistry
provided by theConfigurableCacheFactory
.
- Specified by:
establishMapListeners
in interfaceObservableCachingScheme
- Parameters:
map
- anObservableMap
to which to add aMapListener
(if the map is not observable, no listeners are added)resolver
- theParameterResolver
to use for resolving builder parametersdependencies
- theMapBuilder
dependencies from which to obtain builder information- See Also:
Injectable
-
-
setListenerBuilder
@Injectable("listener") public void setListenerBuilder(ParameterizedBuilder<MapListener> bldr)
Set theParameterizedBuilder
that builds aMapListener
.- Parameters:
bldr
- theParameterizedBuilder
-
getDefaultParameterResolver
public ParameterResolver getDefaultParameterResolver()
Obtains the ParameterResolver to use when resolving parameters without one being available in a context.- Returns:
- a ParameterResolver
-
validate
protected void validate(ParameterResolver resolver)
Validate the properties.- Parameters:
resolver
- the ParameterResolver needed to resolve expressions
-
-