/// <summary> /// Ctor. /// </summary> /// <param name="millisecondLifetimeOldVersions">number of milliseconds a version may hang around before expiry</param> /// <param name="timeProvider">provides the current time</param> /// <param name="optionalStateHandler">a optional plug-in that may store variable state and retrieve state upon creation</param> /// <param name="eventBeanTypedEventFactory">event adapters</param> public VariableManagementServiceImpl( long millisecondLifetimeOldVersions, TimeProvider timeProvider, EventBeanTypedEventFactory eventBeanTypedEventFactory, VariableStateNonConstHandler optionalStateHandler) : this(0, millisecondLifetimeOldVersions, timeProvider, eventBeanTypedEventFactory, optionalStateHandler) { }
/// <summary> /// Ctor. /// </summary> /// <param name="startVersion">the first version number to start from</param> /// <param name="millisecondLifetimeOldVersions">number of milliseconds a version may hang around before expiry</param> /// <param name="timeProvider">provides the current time</param> /// <param name="optionalStateHandler">a optional plug-in that may store variable state and retrieve state upon creation</param> /// <param name="eventBeanTypedEventFactory">for finding event types</param> protected VariableManagementServiceImpl( int startVersion, long millisecondLifetimeOldVersions, TimeProvider timeProvider, EventBeanTypedEventFactory eventBeanTypedEventFactory, VariableStateNonConstHandler optionalStateHandler) { this.millisecondLifetimeOldVersions = millisecondLifetimeOldVersions; this.timeProvider = timeProvider; this.eventBeanTypedEventFactory = eventBeanTypedEventFactory; OptionalStateHandler = optionalStateHandler; DeploymentsWithVariables = new Dictionary<string, VariableDeployment>().WithNullKeySupport(); ReadWriteLock = new SlimReaderWriterLock(60000); variableVersionsPerCP = new List<ConcurrentDictionary<int, VariableReader>>(); changeCallbacksPerCP = new List<IDictionary<int, ICollection<VariableChangeCallback>>>(); currentVersionNumber = startVersion; }