Beispiel #1
0
 private void ExecuteConfigurations(WeldEnvironment environment)
 {
     foreach (var config in environment.Configurations.OrderBy(x => x.Type.Name))
     {
         GetReference(config, CreateCreationalContext(config));
     }
 }
Beispiel #2
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;
        }
Beispiel #3
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);
        }
Beispiel #4
0
 public AttributeScanDeployer(WeldComponentManager manager, WeldEnvironment environment)
 {
     _manager     = manager;
     _environment = environment;
 }