Ejemplo n.º 1
0
        // Token: 0x0600050A RID: 1290 RVA: 0x0001C860 File Offset: 0x0001AA60
        private PartitionBasedADRunspaceServerSettingsProvider GetProviderForPartition(string partitionFqdn)
        {
            ArgumentValidator.ThrowIfNullOrEmpty("partitionFqdn", partitionFqdn);
            TopologyProvider instance = TopologyProvider.GetInstance();
            SyncWrapper <PartitionBasedADRunspaceServerSettingsProvider> orAdd = this.internalProviders.GetOrAdd(partitionFqdn, (string key) => new SyncWrapper <PartitionBasedADRunspaceServerSettingsProvider>());
            PartitionBasedADRunspaceServerSettingsProvider value = orAdd.Value;

            if (value != null && Globals.GetTickDifference(value.LastTopoRecheck, Environment.TickCount) < (ulong)((long)instance.TopoRecheckIntervalMsec))
            {
                ExTraceGlobals.ServerSettingsProviderTracer.TraceDebug <string>((long)this.GetHashCode(), "ADRunspaceServerSettingsProvider {0} ignoring topology version recheck for partition.", partitionFqdn);
                return(value);
            }
            lock (orAdd)
            {
                value = orAdd.Value;
                if (value == null || Globals.GetTickDifference(value.LastTopoRecheck, Environment.TickCount) > (ulong)((long)TopologyProvider.GetInstance().TopoRecheckIntervalMsec))
                {
                    int topologyVersion = instance.GetTopologyVersion(partitionFqdn);
                    if (value == null || value.TopologyVersion != topologyVersion)
                    {
                        ExTraceGlobals.ServerSettingsProviderTracer.TraceDebug <string, int>((long)this.GetHashCode(), "ADRunspaceServerSettingsProvider {0}. Creating new provider version {1}", partitionFqdn, topologyVersion);
                        PartitionBasedADRunspaceServerSettingsProvider value2;
                        if (PartitionBasedADRunspaceServerSettingsProvider.TryCreateNew(partitionFqdn, instance, value, out value2))
                        {
                            orAdd.Value = value2;
                            orAdd.Value.TopologyVersion = topologyVersion;
                            orAdd.Value.LastTopoRecheck = Environment.TickCount;
                        }
                    }
                }
            }
            return(orAdd.Value);
        }