// Token: 0x06000137 RID: 311 RVA: 0x00007738 File Offset: 0x00005938
 private void Initialize(AmRole role, IAmDbState dbState, AmDagConfig dagCfg, string lastError)
 {
     this.Role                = role;
     this.DbState             = dbState;
     this.DagConfig           = dagCfg;
     this.LastError           = lastError;
     this.TimeCreated         = ExDateTime.Now;
     this.TimeRoleLastChanged = this.TimeCreated;
     this.PeriodicEventWatch  = new Stopwatch();
     this.PeriodicEventWatch.Start();
     this.IsUnknownTriggeredByADError = false;
     this.IsCurrentConfiguration      = true;
     this.IsInternalObjectsDisposed   = false;
 }
Exemple #2
0
        private void InitializeFromClusdbInternal()
        {
            AmConfig config = AmSystemManager.Instance.Config;

            if (config.IsPAM)
            {
                AmDagConfig dagConfig = config.DagConfig;
                using (IClusterDB clusterDB = ClusterDB.Open())
                {
                    foreach (AmServerName amServerName in dagConfig.MemberServers)
                    {
                        string keyName = AmThrottledActionTracker <TData> .ConstructRegKeyName(amServerName.NetbiosName);

                        string[] value = clusterDB.GetValue <string[]>(keyName, this.ActionName, null);
                        if (value != null && value.Length > 0)
                        {
                            LinkedList <TData> linkedList = new LinkedList <TData>();
                            foreach (string text in value)
                            {
                                int num = text.IndexOf('=');
                                if (num != -1)
                                {
                                    string s       = text.Substring(0, num);
                                    string dataStr = null;
                                    if (num < text.Length - 1)
                                    {
                                        dataStr = text.Substring(num + 1);
                                    }
                                    ExDateTime actionTime = ExDateTime.Parse(s);
                                    TData      value2     = Activator.CreateInstance <TData>();
                                    value2.Initialize(actionTime, dataStr);
                                    linkedList.AddFirst(value2);
                                }
                            }
                            this.actionHistory[amServerName] = linkedList;
                        }
                    }
                }
            }
        }
 // Token: 0x06000154 RID: 340 RVA: 0x00007D60 File Offset: 0x00005F60
 protected override void InternalDispose(bool disposing)
 {
     lock (this)
     {
         if (disposing)
         {
             AmConfig config = this.Config;
             string   arg    = config.TimeCreated.ToString();
             ExTraceGlobals.AmConfigManagerTracer.TraceDebug <string>(0L, "Disposing AmConfig sub objects (Creation Time: {0})", arg);
             if (config.DbState != null)
             {
                 ExTraceGlobals.AmConfigManagerTracer.TraceDebug <string>(0L, "Disposing DbState of AmConfig (Creation Time: {0})", arg);
                 this.Config.DbState.Dispose();
             }
             AmDagConfig dagConfig = this.Config.DagConfig;
             if (dagConfig != null && dagConfig.Cluster != null)
             {
                 ExTraceGlobals.AmConfigManagerTracer.TraceDebug <string>(0L, "Disposing Cluster of AmConfig (Creation Time: {0})", arg);
                 dagConfig.Cluster.Dispose();
             }
             config.IsInternalObjectsDisposed = true;
         }
     }
 }
 // Token: 0x0600011A RID: 282 RVA: 0x00007509 File Offset: 0x00005709
 internal AmConfig(AmRole role, IAmDbState dbState, AmDagConfig dagCfg, string lastError)
 {
     this.Initialize(role, dbState, dagCfg, lastError);
 }