Ejemplo n.º 1
0
 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;
       }
 }
Ejemplo n.º 2
0
 public virtual void Process(InitializePlantArgs args)
 {
     var iPlant = args.PlantObject as IPlant;
       if (iPlant != null)
       {
     args.IPlantObject = iPlant;
       }
       else
       {
     args.Abort();
       }
 }
Ejemplo n.º 3
0
 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();
       }
 }
Ejemplo n.º 4
0
 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);
       }
 }
Ejemplo n.º 5
0
 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;
 }
Ejemplo n.º 6
0
 public static IPlantEx Run(object plant, ISettingsBox rootSettingsBox)
 {
     var args = new InitializePlantArgs(plant, rootSettingsBox);
       HatcherGuide<IPipelineManager>.Instance.InvokePipeline("initializePlant", args);
       return args.ResolvedPlantEx;
 }
Ejemplo n.º 7
0
 public virtual void Process(InitializePlantArgs args)
 {
     args.PlantSettingsBox = args.RootSettingsBox.GetSubBox(args.PlantID);
 }
Ejemplo n.º 8
0
 public virtual void Process(InitializePlantArgs args)
 {
     args.PlantID = args.PlantObject.GetType().FullName;
 }