cs-codex-dist-tests/Core/EntryPoint.cs

44 lines
1.1 KiB
C#

using KubernetesWorkflow;
using Logging;
namespace Core
{
public class EntryPoint
{
private readonly PluginManager manager = new PluginManager();
public EntryPoint(ILog log, Configuration configuration, string fileManagerRootFolder, ITimeSet timeSet)
{
Tools = new ToolsProvider(log, configuration, fileManagerRootFolder, timeSet);
manager.InstantiatePlugins(PluginFinder.GetPluginTypes(), Tools);
}
public EntryPoint(ILog log, Configuration configuration, string fileManagerRootFolder)
: this(log, configuration, fileManagerRootFolder, new DefaultTimeSet())
{
}
public IPluginTools Tools { get; }
public void Announce()
{
manager.AnnouncePlugins();
}
public CoreInterface CreateInterface()
{
return new CoreInterface(this);
}
public void Decommission()
{
manager.DecommissionPlugins();
}
internal T GetPlugin<T>() where T : IProjectPlugin
{
return manager.GetPlugin<T>();
}
}
}