private bool ValidateConfiguration <TPluginType>(BasePluginConfiguration <TPluginType> config) where TPluginType : BasePluginActor <TPluginType>, new() { var errors = new List <string>(); if (string.IsNullOrEmpty(config.Name)) { errors.Add($"Name must not be null or empty."); } return(errors.Count > 0 ? true : false); }
public IActorRef CreatePlugin <TPluginType>(BasePluginConfiguration <TPluginType> configuration) where TPluginType : BasePluginActor <TPluginType>, new() { var props = PluginSupervisorActor <TPluginType> .GetProps(configuration, PluginRegistryRef); var name = $"{configuration.Name}-plugin-supervisor"; var pluginSupervisor = System.ActorOf(props, name); pluginSupervisor.Tell(new PluginSupervisorMessages.PluginStart()); return(pluginSupervisor); }
public PluginSupervisorActor(BasePluginConfiguration <TPluginType> pluginConfig, IActorRef registry) { _inputs = new Dictionary <string, Type>(); _outputs = new Dictionary <string, Type>(); _subscriberRefs = new Dictionary <string, IActorRef>(); _subscriberTopics = new Dictionary <string, IEnumerable <string> >(); _pluginProps = Props.Create(() => new TPluginType()); _pluginConfig = pluginConfig; _registry = registry; _name = Context.Self.Path.Name; _logger = Context.WithIdentity("PluginSupervisor"); Ready(); }
public static Props GetProps(BasePluginConfiguration <TPluginType> configuration, IActorRef registry) { return(Props.Create(() => new PluginSupervisorActor <TPluginType>(configuration, registry))); }
public Configure(BasePluginConfiguration <TPluginType> configuration) { }