public static IPlantEx Run(object plant, ISettingsBox rootSettingsBox) { var args = new InitializePlantArgs(plant, rootSettingsBox); HatcherGuide <IPipelineManager> .Instance.InvokePipeline("initializePlant", args); return(args.ResolvedPlantEx); }
public virtual void Process(InitializePlantArgs args) { IPlant plant = args.IPlantObject; if (plant.Description.IsNullOrEmpty() || plant.HumanSupportingName.IsNullOrEmpty()) { Log.Warn("Plant '{0}' doesn't provide correct name and description. It will be disabed".FormatWith(args.PlantID), this); args.Abort(); args.ResolvedPlantEx = null; } }
public virtual void Process(InitializePlantArgs args) { var iPlant = args.PlantObject as IPlant; if (iPlant != null) { args.IPlantObject = iPlant; } else { args.Abort(); } }
public virtual void Process(InitializePlantArgs args) { IPlant plant = args.IPlantObject; try { plant.Initialize(); } catch (Exception ex) { Log.Error("Unable to initialize plant {0}".FormatWith(plant.GetType()), ex, this); args.Abort(); } }
public virtual void Process(InitializePlantArgs args) { var plantEx = new PlantEx(); try { plantEx.Initialize(args.IPlantObject, args.Workhorses, args.PlantID, args.PlantSettingsBox); args.ResolvedPlantEx = plantEx; } catch (Exception ex) { Log.Error("Can't initialize PlantEx", ex, this); } }
public virtual void Process(InitializePlantArgs args) { var workhorses = new List<object> { args.PlantObject }; var asExpected = args.PlantObject as IServicesDelegation; if (asExpected != null) { List<object> workhorseCandidates = asExpected.GetServiceDelegates(); if (workhorseCandidates != null) { workhorses.AddRange(workhorseCandidates); } Log.Debug("Plant {0} supports service delegation".FormatWith(args.PlantObject.GetType().FullName), this); } args.Workhorses = workhorses; }
public virtual void Process(InitializePlantArgs args) { var workhorses = new List <object> { args.PlantObject }; var asExpected = args.PlantObject as IServicesDelegation; if (asExpected != null) { List <object> workhorseCandidates = asExpected.GetServiceDelegates(); if (workhorseCandidates != null) { workhorses.AddRange(workhorseCandidates); } Log.Debug("Plant {0} supports service delegation".FormatWith(args.PlantObject.GetType().FullName), this); } args.Workhorses = workhorses; }
public static IPlantEx Run(object plant, ISettingsBox rootSettingsBox) { var args = new InitializePlantArgs(plant, rootSettingsBox); HatcherGuide<IPipelineManager>.Instance.InvokePipeline("initializePlant", args); return args.ResolvedPlantEx; }
public virtual void Process(InitializePlantArgs args) { args.PlantSettingsBox = args.RootSettingsBox.GetSubBox(args.PlantID); }
public virtual void Process(InitializePlantArgs args) { args.PlantID = args.PlantObject.GetType().FullName; }