/// <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; }
public override void SetDataSource(KwsApp _newApp) { if (HasShare()) SrcApp.Share.Deactivate(); base.SetDataSource(_newApp); }
public KasQuery PostAppKasQuery(AnpMsg cmd, Object[] metaData, KasQueryDelegate callback, KwsApp app) { Debug.Assert(app != null); return PostKasQueryInternal(cmd, metaData, callback, app, true); }
public void SetAppDirty(KwsApp app, String reason) { SetDirty(); }
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(); }
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(); }
public void HandleAppFailure(KwsApp app, Exception ex) { Sm.HandleAppFailure(app, ex); }
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; }
/// <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); }