예제 #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);
 }