Beispiel #1
0
 // Token: 0x06000714 RID: 1812 RVA: 0x00015830 File Offset: 0x00013A30
 internal void CompleteBuilding()
 {
     try
     {
         Monitor.Enter(this.lockObject);
         ExAssert.RetailAssert(this.state == SessionDataCacheState.Building || this.state == SessionDataCacheState.Obsolete, "Ready building session data in an invalid state: " + this.state);
         if (this.state == SessionDataCacheState.Obsolete)
         {
             this.InternalDispose(true);
         }
         else
         {
             this.lastSessionDataBuildEndTime = ExDateTime.Now;
             this.state = SessionDataCacheState.Ready;
             this.signalEvent.Set();
             Timer staleTimer = null;
             staleTimer = new Timer(delegate(object param0)
             {
                 this.Dispose();
                 DisposeGuard.DisposeIfPresent(staleTimer);
             }, null, SessionDataCache.FreshnessTime, Timeout.InfiniteTimeSpan);
         }
     }
     finally
     {
         if (Monitor.IsEntered(this.lockObject))
         {
             Monitor.Exit(this.lockObject);
         }
         ExTraceGlobals.SessionDataHandlerTracer.TraceDebug((long)this.GetHashCode(), string.Format("[SessionDataCache] Ready building session data cache. StartTime = {0}, EndTime = {1}, state = {2}", this.lastSessionDataBuildStartTime.ToString(), this.lastSessionDataBuildEndTime.ToString(), this.state));
         OwaSingleCounters.SessionDataCacheBuildsCompleted.Increment();
     }
 }
 // Token: 0x06001C0A RID: 7178 RVA: 0x0006DE44 File Offset: 0x0006C044
 private static void AggregationContextRemoved(string key, object value, CacheItemRemovedReason reason)
 {
     if (reason == CacheItemRemovedReason.Expired)
     {
         ExTraceGlobals.CoreTracer.TraceWarning(0L, "an aggregation context expired before being revalidated!");
         DisposeGuard.DisposeIfPresent(value as IDisposable);
     }
 }
Beispiel #3
0
 // Token: 0x06000717 RID: 1815 RVA: 0x00015B98 File Offset: 0x00013D98
 protected override void InternalDispose(bool disposing)
 {
     if (disposing)
     {
         lock (this.lockObject)
         {
             if (this.state != SessionDataCacheState.Building)
             {
                 DisposeGuard.DisposeIfPresent(this.outputStream);
             }
             this.state = SessionDataCacheState.Obsolete;
         }
     }
 }
        // Token: 0x06001C09 RID: 7177 RVA: 0x0006DD6C File Offset: 0x0006BF6C
        protected override ValidateAggregatedConfigurationResponse InternalExecute()
        {
            ValidateAggregatedConfigurationResponse report = new ValidateAggregatedConfigurationResponse();
            bool   flag  = false;
            object obj   = ValidateAggregatedConfiguration.RemoveFromValidationCache(base.MailboxIdentityMailboxSession);
            bool   flag2 = obj is bool && (bool)obj;

            UserConfigurationManager.IAggregationContext aggregationContext = obj as UserConfigurationManager.IAggregationContext;
            try
            {
                if (flag2)
                {
                    flag = true;
                    ExTraceGlobals.SessionDataHandlerTracer.TraceDebug((long)this.GetHashCode(), "ValidateAggregatedConfiguration was invoked and the aggregator was recently validated.");
                }
                else if (aggregationContext != null)
                {
                    aggregationContext.Validate(base.MailboxIdentityMailboxSession, delegate(IEnumerable <UserConfigurationDescriptor.MementoClass> faisRebuilt, IEnumerable <string> typesRebuilt)
                    {
                        foreach (UserConfigurationDescriptor.MementoClass mementoClass in faisRebuilt)
                        {
                            report.FaiUpdates.Add(mementoClass.ConfigurationName);
                            OwaSingleCounters.AggregatedUserConfigurationPartsRebuilt.Increment();
                            ExTraceGlobals.SessionDataHandlerTracer.TraceError <string>((long)this.GetHashCode(), "error found in configuration type {0}", mementoClass.ConfigurationName);
                        }
                        foreach (string item in typesRebuilt)
                        {
                            report.TypeUpdates.Add(item);
                        }
                    });
                    flag = true;
                }
                if (flag)
                {
                    ValidateAggregatedConfiguration.AddToValidationCache(base.MailboxIdentityMailboxSession, true);
                    report.IsValidated = true;
                }
            }
            finally
            {
                DisposeGuard.DisposeIfPresent(aggregationContext);
            }
            return(report);
        }
Beispiel #5
0
        private void ValidateAndDisposeAggregatedConfiguration(UserConfigurationManager.IAggregationContext aggregator, MailboxSession session)
        {
            bool flag = true;

            try
            {
                if (aggregator != null)
                {
                    aggregator.Detach();
                    if (!base.CallContext.HasDeviceHeaders)
                    {
                        ValidateAggregatedConfiguration.AddToValidationCache(session, aggregator);
                        flag = false;
                    }
                    else
                    {
                        flag = true;
                        ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "user configuration being requested by an offline action.");
                        object obj   = ValidateAggregatedConfiguration.RemoveFromValidationCache(session);
                        bool   flag2 = obj is bool && (bool)obj;
                        if (flag2)
                        {
                            ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "aggregated configuration was already validated during boot.");
                        }
                        else
                        {
                            DisposeGuard.DisposeIfPresent(obj as IDisposable);
                            ExTraceGlobals.CoreTracer.TraceDebug((long)this.GetHashCode(), "aggregated configuration was not validated during boot. validating now.");
                            aggregator.Validate(session, delegate(IEnumerable <UserConfigurationDescriptor.MementoClass> param0, IEnumerable <string> param1)
                            {
                            });
                        }
                        ValidateAggregatedConfiguration.AddToValidationCache(session, true);
                    }
                }
            }
            finally
            {
                if (flag)
                {
                    DisposeGuard.DisposeIfPresent(aggregator);
                }
            }
        }
        private void CommitUpdate(AggregatedUserConfiguration.PendingUpdate pending)
        {
            bool flag = true;

            if (this.memento.ConcurrentUpdates.Contains(pending.DescriptorMemento))
            {
                flag = false;
                ExTraceGlobals.StorageTracer.TraceWarning <string>((long)this.GetHashCode(), "The configuration object with name[{0}] will not be committed because it is in the concurrent update list.", pending.Descriptor.ConfigurationName);
            }
            if (this.RemoveFromPendingAndConcurrent(pending) == 0)
            {
                flag = false;
                ExTraceGlobals.StorageTracer.TraceWarning <string>((long)this.GetHashCode(), "The configuration object with name[{0}] will not be committed because it was not found as a pending update.", pending.Descriptor.ConfigurationName);
            }
            if (flag)
            {
                IUserConfiguration userConfiguration = null;
                AggregatedUserConfigurationPart aggregatedUserConfigurationPart = null;
                try
                {
                    if (this.TryInternalLoadConfiguration(() => pending.Descriptor.GetConfiguration(this.manager), null, delegate(IUserConfiguration c)
                    {
                        pending.Descriptor.Validate(c);
                    }, out userConfiguration))
                    {
                        aggregatedUserConfigurationPart = AggregatedUserConfigurationPart.FromConfiguration(userConfiguration);
                        this.memento.Parts.Add(pending.DescriptorMemento, aggregatedUserConfigurationPart.Memento);
                        this.memento.FailedToLoad.Remove(pending.DescriptorMemento);
                    }
                }
                finally
                {
                    DisposeGuard.DisposeIfPresent(userConfiguration);
                    DisposeGuard.DisposeIfPresent(aggregatedUserConfigurationPart);
                }
            }
            this.SaveMemento(AggregatedUserConfiguration.SaveFailureMode.Fail);
        }
 protected override void InternalDispose(bool disposing)
 {
     DisposeGuard.DisposeIfPresent(this.aggregatedConfiguration);
     base.InternalDispose(disposing);
 }