Show / Hide Table of Contents

Class LocalCache

Provides default implementation of a cache that stores the mapping locally. The mapped-to objects may reside in local or distributed pile as configured

Inheritance
System.Object
DisposableObject
ApplicationComponent
Service
Service<System.Object>
ServiceWithInstrumentationBase<System.Object>
LocalCache
Implements
ILocalizedTimeProvider
ICacheImplementation
ICache
IApplicationComponent
System.IDisposable
IService
INamed
IConfigurable
IInstrumentable
IExternallyParameterized
Inherited Members
Service<Object>.ComponentDirector
Service.CONFIG_NAME_ATTR
Service.ApplicationDontAutoStartService
Service.Status
Service.Running
Service.Name
Service.TimeLocation
Service.LocalizedTime
Service.Configure(IConfigSectionNode)
Service.Start()
Service.SignalStop()
Service.CheckForCompleteStop()
Service.WaitForCompleteStop()
Service.AcceptManagerVisit(Object, DateTime)
Service.UniversalTimeToLocalizedTime(DateTime)
Service.LocalizedTimeToUniversalTime(DateTime)
Service.AbortStart()
Service.DoCheckForCompleteStop()
Service.CheckServiceInactive()
Service.CheckServiceActive()
Service.CheckServiceActiveOrStarting()
Service.DoAcceptManagerVisit(Object, DateTime)
Service.____ObtainPrivateServiceStatusLockObject()
ApplicationComponent.AllComponents
ApplicationComponent.GetAppComponentBySID(UInt64)
ApplicationComponent.GetAppComponentByCommonName(String)
ApplicationComponent.ComponentSID
ApplicationComponent.ComponentStartTime
ApplicationComponent.ComponentCommonName
DisposableObject.DisposeAndNull<T>(T)
DisposableObject.DisposeStarted
DisposableObject.Disposed
DisposableObject.EnsureObjectNotDisposed()
DisposableObject.Dispose()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: NFX.ApplicationModel.Pile
Assembly: NFX.dll
Syntax
public sealed class LocalCache : ServiceWithInstrumentationBase<object>, ILocalizedTimeProvider, ICacheImplementation, ICache, IApplicationComponent, IDisposable, IService, INamed, IConfigurable, IInstrumentable, IExternallyParameterized

Constructors

LocalCache()

Declaration
public LocalCache()

LocalCache(IPileImplementation, Object, String)

Declaration
public LocalCache(IPileImplementation pile, object director, string name)
Parameters
Type Name Description
IPileImplementation pile
System.Object director
System.String name

LocalCache(String, Object)

Declaration
public LocalCache(string name, object director)
Parameters
Type Name Description
System.String name
System.Object director

Fields

DEFAULT_TABLE_OPTIONS_SECTION

Declaration
public const string DEFAULT_TABLE_OPTIONS_SECTION = "default-table-options"
Field Value
Type Description
System.String

Properties

Count

Returns total number of records in cache

Declaration
public long Count { get; }
Property Value
Type Description
System.Int64

DefaultTableOptions

Sets default options for a table which is not found in TableOptions collection. If this property is null then every table assumes the set of constant values defined in Table class

Declaration
public TableOptions DefaultTableOptions { get; set; }
Property Value
Type Description
TableOptions

DetailedInstrumentationForAllTables

Handy admin property that sets detailed instrumentation flag for all tables at once

Declaration
[Config]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public bool ? DetailedInstrumentationForAllTables { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

ExternalParameters

Returns named parameters that can be used to control this component

Declaration
public override IEnumerable<KeyValuePair<string, Type>> ExternalParameters { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>>
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.ExternalParameters

InstrumentationEnabled

Implements IInstrumentable

Declaration
[Config(Default = false)]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public override bool InstrumentationEnabled { get; set; }
Property Value
Type Description
System.Boolean
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.InstrumentationEnabled

Locality

Declaration
public LocalityKind Locality { get; }
Property Value
Type Description
LocalityKind

Persistence

Declaration
public ObjectPersistence Persistence { get; }
Property Value
Type Description
ObjectPersistence

Pile

Gets/sets a pile instance that this cache is using. Can set on an inactive only. If the target pile is directed by this service then it will start/stop the pile, otherwise the pile has to be managed externally

Declaration
public IPileImplementation Pile { get; set; }
Property Value
Type Description
IPileImplementation

PileAllocMode

Declaration
[Config]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public AllocationMode PileAllocMode { get; set; }
Property Value
Type Description
AllocationMode

PileMaxMemoryLimit

Declaration
[Config]
[ExternalParameter(new string[]{"cache", "pile", "instrumentation"})]
public long PileMaxMemoryLimit { get; set; }
Property Value
Type Description
System.Int64

PileStatus

Declaration
public IPileStatus PileStatus { get; }
Property Value
Type Description
IPileStatus

TableOptions

Returns table options - used for table creation

Declaration
public Registry<TableOptions> TableOptions { get; }
Property Value
Type Description
Registry<TableOptions>

Tables

Tables that this cache contains

Declaration
public IRegistry<ICacheTable> Tables { get; }
Property Value
Type Description
IRegistry<ICacheTable>

Methods

Destructor()

Declaration
protected override void Destructor()
Overrides
Service.Destructor()

DoConfigure(IConfigSectionNode)

Declaration
protected override void DoConfigure(IConfigSectionNode node)
Parameters
Type Name Description
IConfigSectionNode node
Overrides
Service.DoConfigure(IConfigSectionNode)

DoSignalStop()

Declaration
protected override void DoSignalStop()
Overrides
Service.DoSignalStop()

DoStart()

Declaration
protected override void DoStart()
Overrides
Service.DoStart()

DoWaitForCompleteStop()

Declaration
protected override void DoWaitForCompleteStop()
Overrides
Service.DoWaitForCompleteStop()

ExternalGetParameter(String, out Object, String[])

Gets external parameter value returning true if parameter was found

Declaration
public override bool ExternalGetParameter(string name, out object value, params string[] groups)
Parameters
Type Name Description
System.String name
System.Object value
System.String[] groups
Returns
Type Description
System.Boolean
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.ExternalGetParameter(System.String, System.Object, System.String[])

ExternalParametersForGroups(String[])

Returns named parameters that can be used to control this component

Declaration
public override IEnumerable<KeyValuePair<string, Type>> ExternalParametersForGroups(params string[] groups)
Parameters
Type Name Description
System.String[] groups
Returns
Type Description
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Type>>
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.ExternalParametersForGroups(System.String[])

ExternalSetParameter(String, Object, String[])

Sets external parameter value returning true if parameter was found and set

Declaration
public override bool ExternalSetParameter(string name, object value, params string[] groups)
Parameters
Type Name Description
System.String name
System.Object value
System.String[] groups
Returns
Type Description
System.Boolean
Overrides
NFX.ServiceModel.ServiceWithInstrumentationBase<System.Object>.ExternalSetParameter(System.String, System.Object, System.String[])

GetOrCreateTable<TKey>(String, out Boolean, IEqualityComparer<TKey>)

Declaration
public ICacheTable<TKey> GetOrCreateTable<TKey>(string tableName, out bool createdNew, IEqualityComparer<TKey> keyComparer = null)
Parameters
Type Name Description
System.String tableName
System.Boolean createdNew
System.Collections.Generic.IEqualityComparer<TKey> keyComparer
Returns
Type Description
ICacheTable<TKey>
Type Parameters
Name Description
TKey

GetOrCreateTable<TKey>(String, IEqualityComparer<TKey>)

Declaration
public ICacheTable<TKey> GetOrCreateTable<TKey>(string tableName, IEqualityComparer<TKey> keyComparer = null)
Parameters
Type Name Description
System.String tableName
System.Collections.Generic.IEqualityComparer<TKey> keyComparer
Returns
Type Description
ICacheTable<TKey>
Type Parameters
Name Description
TKey

GetTable<TKey>(String)

Declaration
public ICacheTable<TKey> GetTable<TKey>(string tableName)
Parameters
Type Name Description
System.String tableName
Returns
Type Description
ICacheTable<TKey>
Type Parameters
Name Description
TKey

PurgeAll()

Declaration
public void PurgeAll()

Implements

ILocalizedTimeProvider
ICacheImplementation
ICache
IApplicationComponent
System.IDisposable
IService
INamed
IConfigurable
IInstrumentable
IExternallyParameterized

Extension Methods

MiscUtils.NonNull<T>(T, Func<Exception>, String)
ObjectValueConversion.AsString(Object, String, ConvertErrorHandling)
ObjectValueConversion.AsNonNullOrEmptyString(Object)
ObjectValueConversion.AsLaconicConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsJSONConfig(Object, ConfigSectionNode, String, ConvertErrorHandling)
ObjectValueConversion.AsXMLConfig(Object, ConfigSectionNode, ConvertErrorHandling)
ObjectValueConversion.AsChar(Object, Char, ConvertErrorHandling)
ObjectValueConversion.AsNullableChar(Object, Nullable<Char>, ConvertErrorHandling)
ObjectValueConversion.AsByte(Object, Byte, ConvertErrorHandling)
ObjectValueConversion.AsNullableByte(Object, Nullable<Byte>, ConvertErrorHandling)
ObjectValueConversion.AsSByte(Object, SByte, ConvertErrorHandling)
ObjectValueConversion.AsNullableSByte(Object, Nullable<SByte>, ConvertErrorHandling)
ObjectValueConversion.AsShort(Object, Int16, ConvertErrorHandling)
ObjectValueConversion.AsNullableShort(Object, Nullable<Int16>, ConvertErrorHandling)
ObjectValueConversion.AsUShort(Object, UInt16, ConvertErrorHandling)
ObjectValueConversion.AsNullableUShort(Object, Nullable<UInt16>, ConvertErrorHandling)
ObjectValueConversion.AsInt(Object, Int32, ConvertErrorHandling)
ObjectValueConversion.AsNullableInt(Object, Nullable<Int32>, ConvertErrorHandling)
ObjectValueConversion.AsUInt(Object, UInt32, ConvertErrorHandling)
ObjectValueConversion.AsNullableUInt(Object, Nullable<UInt32>, ConvertErrorHandling)
ObjectValueConversion.AsLong(Object, Int64, ConvertErrorHandling)
ObjectValueConversion.AsNullableLong(Object, Nullable<Int64>, ConvertErrorHandling)
ObjectValueConversion.AsULong(Object, UInt64, ConvertErrorHandling)
ObjectValueConversion.AsNullableULong(Object, Nullable<UInt64>, ConvertErrorHandling)
ObjectValueConversion.AsDouble(Object, Double, ConvertErrorHandling)
ObjectValueConversion.AsNullableDouble(Object, Nullable<Double>, ConvertErrorHandling)
ObjectValueConversion.AsFloat(Object, Single, ConvertErrorHandling)
ObjectValueConversion.AsNullableFloat(Object, Nullable<Single>, ConvertErrorHandling)
ObjectValueConversion.AsDecimal(Object, Decimal, ConvertErrorHandling)
ObjectValueConversion.AsNullableDecimal(Object, Nullable<Decimal>, ConvertErrorHandling)
ObjectValueConversion.AsBool(Object, Boolean, ConvertErrorHandling)
ObjectValueConversion.AsNullableBool(Object, Nullable<Boolean>, ConvertErrorHandling)
ObjectValueConversion.AsGUID(Object, Guid, ConvertErrorHandling)
ObjectValueConversion.AsNullableGUID(Object, Nullable<Guid>, ConvertErrorHandling)
ObjectValueConversion.AsDateTime(Object)
ObjectValueConversion.AsDateTime(Object, DateTime, ConvertErrorHandling)
ObjectValueConversion.AsNullableDateTime(Object, Nullable<DateTime>, ConvertErrorHandling)
ObjectValueConversion.AsGDID(Object)
ObjectValueConversion.AsGDID(Object, GDID, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDID(Object, Nullable<GDID>, ConvertErrorHandling)
ObjectValueConversion.AsGDIDSymbol(Object)
ObjectValueConversion.AsGDIDSymbol(Object, GDIDSymbol, ConvertErrorHandling)
ObjectValueConversion.AsNullableGDIDSymbol(Object, Nullable<GDIDSymbol>, ConvertErrorHandling)
ObjectValueConversion.AsTimeSpan(Object)
ObjectValueConversion.AsTimeSpan(Object, TimeSpan, ConvertErrorHandling)
ObjectValueConversion.AsNullableTimeSpan(Object, Nullable<TimeSpan>, ConvertErrorHandling)
ObjectValueConversion.AsEnum<TEnum>(Object, TEnum, ConvertErrorHandling)
ObjectValueConversion.AsNullableEnum<TEnum>(Object, Nullable<TEnum>, ConvertErrorHandling)
ObjectValueConversion.AsUri(Object, Uri, ConvertErrorHandling)
CacheExtensions.FetchFrom<TKey, TResult>(ICache, TKey, String, ICacheParams, out Boolean)
CacheExtensions.FetchThrough<TKey, TResult>(ICache, TKey, String, ICacheParams, Func<TKey, TResult>, Func<TKey, TResult, TResult>)
CacheExtensions.DeleteThrough<TKey>(ICache, TKey, String, ICacheParams, Func<TKey, Boolean>)
CacheExtensions.SaveThrough<TKey, TData>(ICache, TKey, TData, String, ICacheParams, Func<TKey, TData, Int32>)
JSONExtensions.ToJSON(Object, JSONWritingOptions)
JSONExtensions.ToJSON(Object, TextWriter, JSONWritingOptions)
JSONExtensions.ToJSON(Object, Stream, JSONWritingOptions, Encoding)
ErlObject.ToErlObject(Object)
ErlObject.ToErlObject(Object, ErlTypeOrder, Boolean)
Back to top Copyright © 2006-2018 Agnicore Inc
Generated by DocFX