Skip navigation links

Oracle® Coherence Java API Reference
Release 12.1.2.0.3

E26043-02


com.tangosol.coherence.config.scheme
Class LocalScheme

java.lang.Object
  extended by com.tangosol.coherence.config.scheme.AbstractScheme
      extended by com.tangosol.coherence.config.scheme.AbstractServiceScheme
          extended by com.tangosol.coherence.config.scheme.AbstractCachingScheme
              extended by com.tangosol.coherence.config.scheme.AbstractLocalCachingScheme
                  extended by com.tangosol.coherence.config.scheme.LocalScheme

All Implemented Interfaces:
BackingMapManagerBuilder, BuilderCustomization, MapBuilder, NamedCacheBuilder, ServiceBuilder, CachingScheme, ObservableCachingScheme, Scheme, ServiceScheme

public class LocalScheme
extends AbstractLocalCachingScheme

The LocalScheme class 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.

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.MapBuilder
MapBuilder.Dependencies

 

Constructor Summary
LocalScheme()
           

 

Method Summary
 CacheStoreScheme getCacheStoreScheme()
          Return the CacheStoreScheme which builds a CacheStore or CacheLoader.
 EvictionPolicyBuilder getEvictionPolicyBuilder()
          Return the EvictionPolicyBuilder used to build an EvictionPolicy.
 Seconds getExpiryDelay(com.tangosol.config.expression.ParameterResolver resolver)
          Return the amount of time since the last update that entries are kept by the cache before being expired.
 Units getHighUnits(com.tangosol.config.expression.ParameterResolver resolver)
          Return the limit of cache size.
 Units getLowUnits(com.tangosol.config.expression.ParameterResolver resolver)
          Return the lowest number of units that a cache is pruned down to when pruning takes place.
 UnitCalculatorBuilder getUnitCalculatorBuilder()
          Return the UnitCalculatorBuilder used to build a UnitCalculator.
 int getUnitFactor(com.tangosol.config.expression.ParameterResolver resolver)
          Return the unit-factor element specifies the factor by which the units, low-units and high-units properties are adjusted.
 boolean isPreLoad(com.tangosol.config.expression.ParameterResolver resolver)
          Return true if a cache pre-loads data from its CacheLoader.
 LocalCache realizeMap(com.tangosol.config.expression.ParameterResolver resolver, MapBuilder.Dependencies dependencies)
          Realize a Map based on the state of the MapBuilder, resolvable parameters and provided MapBuilder.Dependencies.
 void setCacheStoreScheme(CacheStoreScheme scheme)
          Set the CacheStoreScheme which builds a CacheStore or CacheLoader.
 void setEvictionPolicyBuilder(EvictionPolicyBuilder bldr)
          Set the EvictionPolicyBuilder.
 void setExpiryDelay(com.tangosol.config.expression.Expression expr)
          Set the expiry delay.
 void setHighUnits(com.tangosol.config.expression.Expression expr)
          Set the high units.
 void setLowUnits(com.tangosol.config.expression.Expression expr)
          Set the low units.
 void setPreLoad(com.tangosol.config.expression.Expression expr)
          Set the pre-load enabled flag.
 void setUnitCalculatorBuilder(UnitCalculatorBuilder builder)
          Set the UnitCalculatorBuilder.
 void setUnitFactor(com.tangosol.config.expression.Expression expr)
          Set the unit factor.
protected  void validate(com.tangosol.config.expression.ParameterResolver resolver)
          Validate the properties.

 

Methods inherited from class com.tangosol.coherence.config.scheme.AbstractLocalCachingScheme
getCustomBuilder, getEventInterceptorBuilders, getServiceType, isRunningClusterNeeded, setCustomBuilder

 

Methods inherited from class com.tangosol.coherence.config.scheme.AbstractCachingScheme
establishMapListeners, getDefaultParameterResolver, getListenerBuilder, realizeBackingMapManager, realizeCache, setListenerBuilder

 

Methods inherited from class com.tangosol.coherence.config.scheme.AbstractServiceScheme
getScopedServiceName, getScopedServiceName, getScopeName, getServiceBuilder, getServiceName, getXml, injectScopeNameIntoService, isAutoStart, realizeService, setAutoStart, setScopeName, setServiceName, setXml, validate

 

Methods inherited from class com.tangosol.coherence.config.scheme.AbstractScheme
getSchemeName, isAnonymous, setSchemeName

 

Methods inherited from interface com.tangosol.coherence.config.scheme.ServiceScheme
getScopedServiceName, getScopedServiceName, getServiceBuilder, getServiceName, isAutoStart

 

Methods inherited from interface com.tangosol.coherence.config.scheme.Scheme
getSchemeName, isAnonymous

 

Constructor Detail

LocalScheme

public LocalScheme()

Method Detail

realizeMap

public LocalCache realizeMap(com.tangosol.config.expression.ParameterResolver resolver,
                             MapBuilder.Dependencies dependencies)
Realize a Map based on the state of the MapBuilder, resolvable parameters and provided MapBuilder.Dependencies.
Specified by:
realizeMap in interface MapBuilder
Overrides:
realizeMap in class AbstractCachingScheme
Parameters:
resolver - the ParameterResolver
dependencies - the MapBuilder.Dependencies for realizing the Map
Returns:
a Map

getCacheStoreScheme

public CacheStoreScheme getCacheStoreScheme()
Return the CacheStoreScheme which builds a CacheStore or CacheLoader.
Returns:
the CacheStoreScheme

setCacheStoreScheme

@Injectable(value="cachestore-scheme")
public void setCacheStoreScheme(CacheStoreScheme scheme)
Set the CacheStoreScheme which builds a CacheStore or CacheLoader.
Parameters:
scheme - the CacheStoreScheme

getEvictionPolicyBuilder

public EvictionPolicyBuilder getEvictionPolicyBuilder()
Return the EvictionPolicyBuilder used to build an EvictionPolicy.
Returns:
the builder

setEvictionPolicyBuilder

@Injectable(value="eviction-policy")
public void setEvictionPolicyBuilder(EvictionPolicyBuilder bldr)
Set the EvictionPolicyBuilder.
Parameters:
bldr - the EvictionPolicyBuilder

getExpiryDelay

public Seconds getExpiryDelay(com.tangosol.config.expression.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(com.tangosol.config.expression.Expression expr)
Set the expiry delay.
Parameters:
expr - the expiry delay expression

getHighUnits

public Units getHighUnits(com.tangosol.config.expression.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(com.tangosol.config.expression.Expression expr)
Set the high units.
Parameters:
expr - the high units expression

getLowUnits

public Units getLowUnits(com.tangosol.config.expression.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(com.tangosol.config.expression.Expression expr)
Set the low units.
Parameters:
expr - the low units

isPreLoad

public boolean isPreLoad(com.tangosol.config.expression.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(com.tangosol.config.expression.Expression expr)
Set the pre-load enabled flag.
Parameters:
expr - true to enable pre-load

getUnitCalculatorBuilder

public UnitCalculatorBuilder getUnitCalculatorBuilder()
Return the UnitCalculatorBuilder used to build a UnitCalculator.
Returns:
the unit calculator

setUnitCalculatorBuilder

@Injectable(value="unit-calculator")
public void setUnitCalculatorBuilder(UnitCalculatorBuilder builder)
Set the UnitCalculatorBuilder.
Parameters:
builder - the UnitCalculatorBuilder

getUnitFactor

public int getUnitFactor(com.tangosol.config.expression.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(com.tangosol.config.expression.Expression expr)
Set the unit factor.
Parameters:
expr - the unit factor expression

validate

protected void validate(com.tangosol.config.expression.ParameterResolver resolver)
Validate the properties.
Overrides:
validate in class AbstractCachingScheme
Parameters:
resolver - the ParameterResolver needed to resolve expressions

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.