Class LocalScheme
- 
- All Implemented Interfaces:
- BackingMapManagerBuilder,- BuilderCustomization<LocalCache>,- MapBuilder,- NamedCacheBuilder,- ServiceBuilder,- CachingScheme,- ObservableCachingScheme,- Scheme,- ServiceScheme
 
 public class LocalScheme extends AbstractLocalCachingScheme<LocalCache> TheLocalSchemeclass is responsible for building a fully configured instance of a LocalCache. Note that a LocalCache may be used as a stand-alone cache or as part of a backing map.This class 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 ResourceRegistryprovided by theConfigurableCacheFactory.
 - Since:
- Coherence 12.1.2
- Author:
- pfm 2011.10.30
- See Also:
- Injectable
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.MapBuilderMapBuilder.Dependencies
 
- 
 - 
Field Summary- 
Fields inherited from class com.tangosol.coherence.config.scheme.AbstractServiceSchemem_serviceDependencies
 - 
Fields inherited from interface com.tangosol.coherence.config.scheme.ServiceSchemeDELIM_APPLICATION_SCOPE, DELIM_DOMAIN_PARTITION
 
- 
 - 
Constructor SummaryConstructors Constructor Description LocalScheme()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheStoreSchemegetCacheStoreScheme()Return theCacheStoreSchemewhich builds a CacheStore or CacheLoader.EvictionPolicyBuildergetEvictionPolicyBuilder()Return the EvictionPolicyBuilder used to build an EvictionPolicy.SecondsgetExpiryDelay(ParameterResolver resolver)Return the amount of time since the last update that entries are kept by the cache before being expired.UnitsgetHighUnits(ParameterResolver resolver)Return the limit of cache size.UnitsgetLowUnits(ParameterResolver resolver)Return the lowest number of units that a cache is pruned down to when pruning takes place.UnitCalculatorBuildergetUnitCalculatorBuilder()Return the UnitCalculatorBuilder used to build a UnitCalculator.intgetUnitFactor(ParameterResolver resolver)Return the unit-factor element specifies the factor by which the units, low-units and high-units properties are adjusted.booleanisPreLoad(ParameterResolver resolver)Return true if a cache pre-loads data from its CacheLoader.LocalCacherealizeMap(ParameterResolver resolver, MapBuilder.Dependencies dependencies)Realize aMapbased on the state of theMapBuilder, resolvable parameters and providedMapBuilder.Dependencies.voidsetCacheStoreScheme(CacheStoreScheme scheme)Set theCacheStoreSchemewhich builds a CacheStore or CacheLoader.voidsetEvictionPolicyBuilder(EvictionPolicyBuilder bldr)Set the EvictionPolicyBuilder.voidsetExpiryDelay(Expression<Seconds> expr)Set the expiry delay.voidsetHighUnits(Expression<Units> expr)Set the high units.voidsetLowUnits(Expression<Units> expr)Set the low units.voidsetPreLoad(Expression<Boolean> expr)Set the pre-load enabled flag.voidsetUnitCalculatorBuilder(UnitCalculatorBuilder builder)Set the UnitCalculatorBuilder.voidsetUnitFactor(Expression<Integer> expr)Set the unit factor.protected voidvalidate(ParameterResolver resolver)Validate the properties.- 
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractLocalCachingSchemegetCustomBuilder, getEventInterceptorBuilders, getServiceType, isRunningClusterNeeded, setCustomBuilder
 - 
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractCachingSchemeestablishMapListeners, getDefaultParameterResolver, getListenerBuilder, realizeBackingMapManager, realizeCache, setListenerBuilder
 - 
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractServiceSchemeensureService, getDefaultServiceName, getScopedServiceName, getScopeName, getServiceBuilder, getServiceDependencies, getServiceName, getXml, injectScopeNameIntoService, isAutoStart, realizeService, setAutoStart, setScopeName, setServiceDependencies, setServiceName, setXml
 - 
Methods inherited from class com.tangosol.coherence.config.scheme.AbstractSchemegetSchemeName, isAnonymous, setSchemeName, validate
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.tangosol.coherence.config.scheme.SchemegetSchemeName, isAnonymous
 - 
Methods inherited from interface com.tangosol.coherence.config.scheme.ServiceSchemegetScopedServiceName, getServiceBuilder, getServiceName, isAutoStart
 
- 
 
- 
- 
- 
Method Detail- 
realizeMappublic LocalCache realizeMap(ParameterResolver resolver, MapBuilder.Dependencies dependencies) Realize aMapbased on the state of theMapBuilder, resolvable parameters and providedMapBuilder.Dependencies.- Specified by:
- realizeMapin interface- MapBuilder
- Overrides:
- realizeMapin class- AbstractCachingScheme
- Parameters:
- resolver- the- ParameterResolver
- dependencies- the- MapBuilder.Dependenciesfor realizing the- Map
- Returns:
- a Map
 
 - 
getCacheStoreSchemepublic CacheStoreScheme getCacheStoreScheme() Return theCacheStoreSchemewhich builds a CacheStore or CacheLoader.- Returns:
- the CacheStoreScheme
 
 - 
setCacheStoreScheme@Injectable("cachestore-scheme") public void setCacheStoreScheme(CacheStoreScheme scheme) Set theCacheStoreSchemewhich builds a CacheStore or CacheLoader.- Parameters:
- scheme- the CacheStoreScheme
 
 - 
getEvictionPolicyBuilderpublic EvictionPolicyBuilder getEvictionPolicyBuilder() Return the EvictionPolicyBuilder used to build an EvictionPolicy.- Returns:
- the builder
 
 - 
setEvictionPolicyBuilder@Injectable("eviction-policy") public void setEvictionPolicyBuilder(EvictionPolicyBuilder bldr) Set the EvictionPolicyBuilder.- Parameters:
- bldr- the EvictionPolicyBuilder
 
 - 
getExpiryDelaypublic Seconds getExpiryDelay(ParameterResolver resolver) Return the amount of time since the last update that entries are kept by the cache before being expired. Entries that have expired are not accessible and are evicted the next time a client accesses the cache. Any attempt to read an expired entry results in a reloading of the entry from the CacheStore.- Parameters:
- resolver- the ParameterResolver
- Returns:
- the expiry delay
 
 - 
setExpiryDelay@Injectable public void setExpiryDelay(Expression<Seconds> expr) Set the expiry delay.- Parameters:
- expr- the expiry delay expression
 
 - 
getHighUnitspublic Units getHighUnits(ParameterResolver resolver) Return the limit of cache size. Contains the maximum number of units that can be placed n the cache before pruning occurs. An entry is the unit of measurement, unless it is overridden by an alternate unit-calculator. When this limit is exceeded, the cache begins the pruning process, evicting entries according to the eviction policy. Legal values are positive integers or zero. Zero implies no limit.- Parameters:
- resolver- the ParameterResolver
- Returns:
- the high units
 
 - 
setHighUnits@Injectable public void setHighUnits(Expression<Units> expr) Set the high units.- Parameters:
- expr- the high units expression
 
 - 
getLowUnitspublic Units getLowUnits(ParameterResolver resolver) Return the lowest number of units that a cache is pruned down to when pruning takes place. A pruning does not necessarily result in a cache containing this number of units, however a pruning never results in a cache containing less than this number of units. An entry is the unit of measurement, unless it is overridden by an alternate unit-calculator. When pruning occurs entries continue to be evicted according to the eviction policy until this size. Legal values are positive integers or zero. Zero implies the default. The default value is 75% of the high-units setting (that is, for a high-units setting of 1000 the default low-units is 750).- Parameters:
- resolver- the ParameterResolver
- Returns:
- the low units
 
 - 
setLowUnits@Injectable public void setLowUnits(Expression<Units> expr) Set the low units.- Parameters:
- expr- the low units
 
 - 
isPreLoadpublic boolean isPreLoad(ParameterResolver resolver) Return true if a cache pre-loads data from its CacheLoader.- Parameters:
- resolver- the ParameterResolver
- Returns:
- true if pre-load is enabled
 
 - 
setPreLoad@Injectable public void setPreLoad(Expression<Boolean> expr) Set the pre-load enabled flag.- Parameters:
- expr- true to enable pre-load
 
 - 
getUnitCalculatorBuilderpublic UnitCalculatorBuilder getUnitCalculatorBuilder() Return the UnitCalculatorBuilder used to build a UnitCalculator.- Returns:
- the unit calculator
 
 - 
setUnitCalculatorBuilder@Injectable("unit-calculator") public void setUnitCalculatorBuilder(UnitCalculatorBuilder builder) Set the UnitCalculatorBuilder.- Parameters:
- builder- the UnitCalculatorBuilder
 
 - 
getUnitFactorpublic int getUnitFactor(ParameterResolver resolver) Return the unit-factor element specifies the factor by which the units, low-units and high-units properties are adjusted. Using a BINARY unit calculator, for example, the factor of 1048576 could be used to count megabytes instead of bytes.- Parameters:
- resolver- the ParameterResolver
- Returns:
- the unit factor
 
 - 
setUnitFactor@Injectable public void setUnitFactor(Expression<Integer> expr) Set the unit factor.- Parameters:
- expr- the unit factor expression
 
 - 
validateprotected void validate(ParameterResolver resolver) Validate the properties.- Overrides:
- validatein class- AbstractCachingScheme
- Parameters:
- resolver- the ParameterResolver needed to resolve expressions
 
 
- 
 
-