-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInstrumentConfiguration.cs
More file actions
62 lines (57 loc) · 2.38 KB
/
InstrumentConfiguration.cs
File metadata and controls
62 lines (57 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// =================================================================================================================================
// Copyright (c) RapidField LLC. Licensed under the MIT License. See LICENSE.txt in the project root for license information.
// =================================================================================================================================
using Microsoft.Extensions.Configuration;
using RapidField.SolidInstruments.Core.Concurrency;
using System;
using System.Diagnostics;
using System.Threading;
namespace RapidField.SolidInstruments.Core
{
/// <summary>
/// Represents configuration information for a <see cref="ConfigurableInstrument{TConfiguration}" /> instance.
/// </summary>
/// <remarks>
/// <see cref="InstrumentConfiguration" /> is the default implementation of <see cref="IInstrumentConfiguration" />.
/// </remarks>
public abstract class InstrumentConfiguration : IInstrumentConfiguration
{
/// <summary>
/// Initializes a new instance of the <see cref="InstrumentConfiguration" /> class.
/// </summary>
protected InstrumentConfiguration()
{
Application = null;
StateControlMode = Instrument.DefaultStateControlMode;
StateControlTimeoutThreshold = Instrument.DefaultStateControlTimeoutThreshold;
}
/// <summary>
/// Gets or sets configuration information for the application.
/// </summary>
public IConfiguration Application
{
get;
set;
}
/// <summary>
/// Gets or sets the concurrency control mode that is used to manage state for the associated
/// <see cref="ConfigurableInstrument{TConfiguration}" />.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public ConcurrencyControlMode StateControlMode
{
get;
set;
}
/// <summary>
/// Gets or sets the maximum length of time that the instrument's state control may block a thread before raising an
/// exception, or <see cref="Timeout.InfiniteTimeSpan" /> if indefinite thread blocking is permitted.
/// </summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
public TimeSpan StateControlTimeoutThreshold
{
get;
set;
}
}
}