Esempio n. 1
0
        StatusInfoCollection IManagedAppBase.CollectStatus()
        {
            var status = m_AppStatus;

            if (status == null)
            {
                status             = new StatusInfoCollection();
                status.Name        = Name;
                status.Tag         = Name;
                status.StartedTime = StartedTime;
                m_AppStatus        = status;
            }

            UpdateStatus(status);
            Task.Factory.StartNew(() => OnStatusCollected(status)).ContinueWith(t =>
            {
                Logger.LogAggregateException("Exception happend in OnStatusCollected.", t.Exception);
            }, TaskContinuationOptions.OnlyOnFaulted);
            return(status);
        }
Esempio n. 2
0
 /// <summary>
 /// Called when [status collected].
 /// </summary>
 /// <param name="status">The app status.</param>
 protected virtual void OnStatusCollected(StatusInfoCollection status)
 {
 }
Esempio n. 3
0
 protected virtual void UpdateStatus(StatusInfoCollection status)
 {
     status[StatusInfoKeys.IsRunning] = (State == ServerState.Running);
 }
Esempio n. 4
0
 public AppServerStatus(AppServerMetadata metadata, StatusInfoCollection dataCollection)
 {
     Metadata       = metadata;
     DataCollection = dataCollection;
 }