Example #1
0
 public bool ReadyToBuild(IComponentInfo info)
 {
     IObjectBuildContext ctx = new ObjectBuildContext(info, _k);
     foreach (IPolicy p in info.BuildPolicies)
     {
         if (!p.ReadyToBuild(ctx))
             return false;
     }
     return true;
 }
Example #2
0
        public bool ReadyToBuild(IComponentInfo info)
        {
            IObjectBuildContext ctx = new ObjectBuildContext(info, _k);

            foreach (IPolicy p in info.BuildPolicies)
            {
                if (!p.ReadyToBuild(ctx))
                {
                    return(false);
                }
            }
            return(true);
        }
Example #3
0
        public IObjectBuildContext Build(IComponentInfo info)
        {
            IObjectBuildContext ctx = new ObjectBuildContext(info, _k);

            _log.Debug("Build [PreCreation] policies.");
            BuildUpSteps(ctx, Stages.PreCreation);
            _log.Debug("Build [Creation] policies.");
            BuildUpSteps(ctx, Stages.Creation);
            _log.Debug("Build [Initialization] policies.");
            BuildUpSteps(ctx, Stages.Initialization);
            _log.Debug("Build [PostInitialization] policies.");
            BuildUpSteps(ctx, Stages.PostInitialization);

            //Note:Notify all policy(let precreation policy have chance to know instance created).
            _log.Debug("Notify policies build complete.");
            foreach (IPolicy policy in info.BuildPolicies)
                policy.OnBuildComplete(ctx);

            _log.Debug("Build completed.");
            return ctx;
        }
Example #4
0
        public IObjectBuildContext Build(IComponentInfo info)
        {
            IObjectBuildContext ctx = new ObjectBuildContext(info, _k);

            _log.Debug("Build [PreCreation] policies.");
            BuildUpSteps(ctx, Stages.PreCreation);
            _log.Debug("Build [Creation] policies.");
            BuildUpSteps(ctx, Stages.Creation);
            _log.Debug("Build [Initialization] policies.");
            BuildUpSteps(ctx, Stages.Initialization);
            _log.Debug("Build [PostInitialization] policies.");
            BuildUpSteps(ctx, Stages.PostInitialization);

            //Note:Notify all policy(let precreation policy have chance to know instance created).
            _log.Debug("Notify policies build complete.");
            foreach (IPolicy policy in info.BuildPolicies)
            {
                policy.OnBuildComplete(ctx);
            }

            _log.Debug("Build completed.");
            return(ctx);
        }