2023-09-13 08:03:11 +00:00
|
|
|
|
using KubernetesWorkflow;
|
2023-09-12 12:50:18 +00:00
|
|
|
|
using Logging;
|
|
|
|
|
|
|
|
|
|
namespace Core
|
|
|
|
|
{
|
2023-09-13 08:03:11 +00:00
|
|
|
|
public class EntryPoint
|
2023-09-12 12:50:18 +00:00
|
|
|
|
{
|
2023-09-13 08:23:05 +00:00
|
|
|
|
private readonly IToolsFactory toolsFactory;
|
2023-09-12 12:50:18 +00:00
|
|
|
|
private readonly PluginManager manager = new PluginManager();
|
2023-09-13 08:23:05 +00:00
|
|
|
|
|
2023-09-12 12:50:18 +00:00
|
|
|
|
public EntryPoint(ILog log, Configuration configuration, string fileManagerRootFolder, ITimeSet timeSet)
|
|
|
|
|
{
|
2023-09-13 08:23:05 +00:00
|
|
|
|
toolsFactory = new ToolsFactory(log, configuration, fileManagerRootFolder, timeSet);
|
|
|
|
|
|
|
|
|
|
Tools = toolsFactory.CreateTools();
|
|
|
|
|
manager.InstantiatePlugins(PluginFinder.GetPluginTypes(), toolsFactory);
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntryPoint(ILog log, Configuration configuration, string fileManagerRootFolder)
|
|
|
|
|
: this(log, configuration, fileManagerRootFolder, new DefaultTimeSet())
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-13 08:03:11 +00:00
|
|
|
|
public IPluginTools Tools { get; }
|
2023-09-12 12:50:18 +00:00
|
|
|
|
|
2023-09-13 08:03:11 +00:00
|
|
|
|
public void Announce()
|
2023-09-12 12:50:18 +00:00
|
|
|
|
{
|
2023-09-13 08:03:11 +00:00
|
|
|
|
manager.AnnouncePlugins();
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CoreInterface CreateInterface()
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return new CoreInterface(this);
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Decommission()
|
|
|
|
|
{
|
2023-09-13 08:03:11 +00:00
|
|
|
|
manager.DecommissionPlugins();
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal T GetPlugin<T>() where T : IProjectPlugin
|
|
|
|
|
{
|
|
|
|
|
return manager.GetPlugin<T>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|