public IYodiiEngineResult SetDiscoveredInfo(IDiscoveredInfo info) { if (info == null) { throw new ArgumentNullException("info"); } if (info == _discoveredInfo) { return(_successResult); } if (IsRunning) { var r = ConfigurationSolver.CreateAndApplyStaticResolution(this, _manager.FinalConfiguration, info, false, false, false); if (r.Item1 != null) { Debug.Assert(!r.Item1.Success, "Not null means necessarily an error."); Debug.Assert(r.Item1.Engine == this); return(r.Item1); } return(DoDynamicResolution(r.Item2, null, null, () => DiscoveredInfo = info)); } else { DiscoveredInfo = info; } return(_successResult); }
/// <summary> /// Triggers the static resolution of the graph (with the current <see cref="DiscoveredInfo"/> and <see cref="Configuration"/>). /// This has no impact on the engine and can be called when <see cref="IsRunning"/> is false. /// </summary> /// <param name="revertServices">True to revert the list of the services (based on their <see cref="IServiceInfo.ServiceFullName"/>).</param> /// <param name="revertPlugins">True to revert the list of the plugins (based on their <see cref="IPluginInfo.PluginFullName"/>).</param> /// <returns> /// The result with a potential non null <see cref="IYodiiEngineResult.StaticFailureResult"/> but always an /// available <see cref="IYodiiEngineStaticOnlyResult.StaticSolvedConfiguration"/>. /// </returns> public IYodiiEngineStaticOnlyResult StaticResolutionOnly(bool revertServices, bool revertPlugins) { var r = ConfigurationSolver.CreateAndApplyStaticResolution(this, _manager.FinalConfiguration, _discoveredInfo, revertServices, revertPlugins, createStaticSolvedConfigOnSuccess: true); Debug.Assert(r.Item1 != null, "Either an error or a successful static resolution."); return(r.Item1); }
public IYodiiEngineResult Start(bool revertServices, bool revertPlugins, IEnumerable <YodiiCommand> persistedCommands = null) { if (!IsRunning) { _yodiiCommands.Clear(); if (persistedCommands != null) { _yodiiCommands.AddRange(persistedCommands); } var r = ConfigurationSolver.CreateAndApplyStaticResolution(this, _manager.FinalConfiguration, _discoveredInfo, revertServices, revertPlugins, false); if (r.Item1 != null) { Debug.Assert(!r.Item1.Success, "Not null means necessarily an error."); Debug.Assert(r.Item1.Engine == this); return(r.Item1); } return(DoDynamicResolution(r.Item2, null, null)); } return(_successResult); }
internal Tuple <IYodiiEngineStaticOnlyResult, ConfigurationSolver> StaticResolutionByConfigurationManager(FinalConfiguration finalConfiguration) { Debug.Assert(IsRunning); return(ConfigurationSolver.CreateAndApplyStaticResolution(this, finalConfiguration, _discoveredInfo, false, false, false)); }