Пример #1
0
        public void Deploy(WeldEnvironment environment)
        {
            Container.Instance.Initialize(this);
            environment.AddValue(this, new IQualifier[0], this);
            environment.AddValue(new ContextualStore(), new IQualifier[0], this);

            _allMixins       = environment.Components.OfType <Mixin>().ToArray();
            _allInterceptors = environment.Components.OfType <Interceptor>().ToArray();
            _allComponents   = new ConcurrentBag <IWeldComponent>(environment.Components.Except(_allMixins).Except(_allInterceptors));

            ValidateComponents();
            ExecuteConfigurations(environment);
            _isDeployed = true;
        }
Пример #2
0
        public void Deploy(WeldEnvironment environment)
        {
            environment.AddValue(this, new IAnnotation[0], this);
            environment.AddValue(new ContextualStore(), new IAnnotation[0], this);

            var mixins       = environment.Components.OfType <Mixin>().ToArray();
            var interceptors = environment.Components.OfType <Interceptor>().ToArray();

            _registeredComponents.AddRange(environment.Components.Except(mixins).Except(interceptors));
            _componentResolver.Invalidate();
            AddObservers(environment.Observers);

            _mixinResolver       = new MixinResolver(this, mixins);
            _interceptorResolver = new InterceptorResolver(this, interceptors);
            _services.Add(typeof(IExceptionHandlerDispatcher), new ExceptionHandlerDispatcher(this, environment.ExceptionHandlers));

            _componentResolver.Validate();

            ExecuteConfigurations(environment);
        }
Пример #3
0
 public void AddValue(object instance, params IBinderAttribute[] binders)
 {
     _environment.AddValue(instance, binders, _manager);
 }
Пример #4
0
 public void AddValue(object instance, params IAnnotation[] annotations)
 {
     _environment.AddValue(instance, annotations, _manager);
 }