Esempio n. 1
0
 /// <summary>
 /// Helper for PostNonAppKasQuery() and PostKasQuery().
 /// </summary>
 private WmKasQuery PostKasQueryInternal(AnpMsg cmd, Object[] metaData, KasQueryDelegate callback, KwsApp app,
     bool clearOnLogoutFlag)
 {
     WmKasQuery query = new WmKasQuery(cmd, metaData, callback, Kas, this, app, clearOnLogoutFlag);
     m_wm.Sm.PostKasQuery(query);
     return query;
 }
Esempio n. 2
0
 public override void SetDataSource(KwsApp _newApp)
 {
     if (HasShare()) SrcApp.Share.Deactivate();
     base.SetDataSource(_newApp);
 }
Esempio n. 3
0
 public KasQuery PostAppKasQuery(AnpMsg cmd, Object[] metaData, KasQueryDelegate callback, KwsApp app)
 {
     Debug.Assert(app != null);
     return PostKasQueryInternal(cmd, metaData, callback, app, true);
 }
Esempio n. 4
0
 public void SetAppDirty(KwsApp app, String reason)
 {
     SetDirty();
 }
Esempio n. 5
0
        public void OnAppStopped(KwsApp app)
        {
            if (app.AppStatus != KwsAppStatus.Stopping && app.AppStatus != KwsAppStatus.Stopped)
            {
                Logging.Log(2, "OnAppStopped() called when app not stopping/stopped");
                return;
            }

            app.AppStatus = KwsAppStatus.Stopped;
            Sm.OnAppStopped();
        }
Esempio n. 6
0
        public void OnAppStarted(KwsApp app)
        {
            if (app.AppStatus != KwsAppStatus.Starting)
            {
                Logging.Log(2, "OnAppStarted() called when app not starting");
                return;
            }

            app.AppStatus = KwsAppStatus.Started;
            Sm.OnAppStarted();
        }
Esempio n. 7
0
 public void HandleAppFailure(KwsApp app, Exception ex)
 {
     Sm.HandleAppFailure(app, ex);
 }
Esempio n. 8
0
 public WmKasQuery(AnpMsg cmd, Object[] metaData, KasQueryDelegate callback,
     WmKas kas, Workspace kws, KwsApp app, bool clearOnLogoutFlag)
     : base(cmd, metaData, callback)
 {
     Kas = kas;
     Kws = kws;
     App = app;
     ClearOnLogoutFlag = clearOnLogoutFlag;
 }
Esempio n. 9
0
        /// <summary>
        /// This method should be called when an application fails.
        /// </summary>
        public void HandleAppFailure(KwsApp app, Exception ex)
        {
            Logging.Log(2, "Application " + app + " failed: " + ex.Message);
            Logging.LogException(ex);

            // We cannot handle application failures during task switches:
            // we are stopping the applications.
            if (m_taskSwitchFlag) Base.HandleException(ex, true);

            // Set the application exception.
            m_kws.AppException = ex;

            // Increase the severity of the rebuild required if possible.
            if (m_currentTask == KwsTask.Rebuild)
            {
                KwsRebuildInfo rebuildInfo = new KwsRebuildInfo();
                rebuildInfo.DeleteCachedEventsFlag = true;
                rebuildInfo.DeleteLocalDataFlag = true;
                WorsenRebuild(rebuildInfo);
            }

            // Run the state machine to adjust the state.
            RequestRun("application failure");
            m_kws.StateChangeUpdate(false);

            // Notify the listeners.
            m_kws.FireKwsSmNotif(new KwsSmNotifEventArgs(KwsSmNotif.AppFailure, ex));

            // Stop the workspace if required.
            SetUserTask(KwsTask.Stop);
            RequestTaskSwitch(KwsTask.Stop);
        }