private static Configuration LoadAllFilesFromChain(string path, string resourcePostfix, IConfigurationInterpreter interpreter)
        {
            var files = new List<FileInfo>();

            var d = new DirectoryInfo(path);
            do
            {
                var userConfig =
                    d.GetFiles()
                        .Where(r => r.Name.EndsWith(resourcePostfix, StringComparison.OrdinalIgnoreCase))
                        .OrderByDescending(c => c.Name);

                files.AddRange(userConfig);
                d = d.Parent;
            } while (d != null);

            files.Reverse();

            return files.Select(c => File.ReadAllText(c.FullName))
                        .Aggregate(new Configuration(), (current, resource) =>
                        {
                            var obj = interpreter.ParseConfiguration(resource);
                            return current.UpdateWith(obj);
                        });
        }
		public DefaultMassTransitContainer(IConfigurationInterpreter configurationInterpreter)
			: base(configurationInterpreter)
		{
			Initialize();

			AddMassTransitFacility();
		}
        public DefaultMassTransitContainer(IConfigurationInterpreter configurationInterpreter)
            : base(configurationInterpreter)
        {
            Initialize();

            AddFactoryFacility();
            AddMassTransitFacility();
        }
 private static Configuration GetExpandoFromAssemblies(IEnumerable<Assembly> assemblies, string resourcePostfix, IConfigurationInterpreter interpreter)
 {
     return assemblies.SelectMany(assembly => ReadEmbededResources(assembly, resourcePostfix)).Aggregate(new Configuration(), (current, resource) =>
     {
         var obj = interpreter.ParseConfiguration(resource);
         return current.UpdateWith(obj);
     });
 }
		/// <summary>
		/// Initializes a new instance of the ConfigurationInstaller class.
		/// </summary>
		public ConfigurationInstaller(IConfigurationInterpreter interpreter)
		{
			if (interpreter == null)
			{
				throw new ArgumentNullException("interpreter");
			}
			this.interpreter = interpreter;
		}
    public ExtendedWindsorContainer(IConfigurationInterpreter interpreter)
      : base(CreateKernel(), new DefaultComponentInstaller())
    {
      if (interpreter == null) throw new ArgumentNullException("interpreter");

      interpreter.ProcessResource(interpreter.Source, Kernel.ConfigurationStore);

      RunInstaller();
    }
Example #7
0
        /// <summary>
        ///   Constructs a container using the specified
        ///   <see cref = "IConfigurationInterpreter" /> implementation.
        /// </summary>
        /// <param name = "interpreter">The instance of an <see cref = "IConfigurationInterpreter" /> implementation.</param>
        public WindsorContainer(IConfigurationInterpreter interpreter) : this()
        {
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }
            interpreter.ProcessResource(interpreter.Source, kernel.ConfigurationStore, kernel);

            RunInstaller();
        }
Example #8
0
        private void InitalizeFromConfigurationSource(IConfigurationInterpreter interpreter)
        {
            DefaultConversionManager conversionManager =
                (DefaultConversionManager)Kernel.GetSubSystem(SubSystemConstants.ConversionManagerKey);

            conversionManager.Add(new ConfigurationObjectConverter());

            interpreter.ProcessResource(interpreter.Source, Kernel.ConfigurationStore);
            RunInstaller();
        }
        public ExtendedWindsorContainer(IConfigurationInterpreter interpreter)
            : base(CreateKernel(), new DefaultComponentInstaller())
        {
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }

            interpreter.ProcessResource(interpreter.Source, Kernel.ConfigurationStore);

            RunInstaller();
        }
Example #10
0
        private void InitalizeFromConfigurationSource(IConfigurationInterpreter interpreter,
                                                      IEnvironmentInfo env)
        {
            var conversionManager = (DefaultConversionManager)Kernel.GetSubSystem(SubSystemConstants.ConversionManagerKey);

            conversionManager.Add(new ConfigurationObjectConverter());

            if (env != null)
            {
                interpreter.EnvironmentName = env.GetEnvironmentName();
            }

            interpreter.ProcessResource(interpreter.Source, Kernel.ConfigurationStore, Kernel);
            RunInstaller();
        }
        public WindsorContainer(IConfigurationInterpreter parent, IConfigurationInterpreter child) : this()
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }

            _kernel.ConfigurationStore = new CascadeConfigurationStore(parent, child);

            RunInstaller();
        }
Example #12
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "WindsorContainer" /> class.
        /// </summary>
        /// <param name = "interpreter">The interpreter.</param>
        /// <param name = "environmentInfo">The environment info.</param>
        public WindsorContainer(IConfigurationInterpreter interpreter, IEnvironmentInfo environmentInfo) : this()
        {
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }
            if (environmentInfo == null)
            {
                throw new ArgumentNullException("environmentInfo");
            }

            interpreter.EnvironmentName = environmentInfo.GetEnvironmentName();
            interpreter.ProcessResource(interpreter.Source, kernel.ConfigurationStore, kernel);

            RunInstaller();
        }
Example #13
0
		public MyContainer(IConfigurationInterpreter interpreter)
		{
			// Registers the type converter:
			
			IConversionManager manager = (IConversionManager)
				Kernel.GetSubSystem(Castle.MicroKernel.SubSystemConstants.ConversionManagerKey);
			
			manager.Add(new ServerConfigConverter());
			
			// Process the configuration
			
			interpreter.ProcessResource(interpreter.Source, Kernel.ConfigurationStore);
			
			// Install the components
			
			Installer.SetUp(this, Kernel.ConfigurationStore);
		}
Example #14
0
        /// <summary>
        ///   Constructs a container assigning a parent container
        ///   before starting the dependency resolution.
        /// </summary>
        /// <param name = "parent">The instance of an <see cref = "IWindsorContainer" /></param>
        /// <param name = "interpreter">The instance of an <see cref = "IConfigurationInterpreter" /> implementation</param>
        public WindsorContainer(IWindsorContainer parent, IConfigurationInterpreter interpreter) : this()
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (interpreter == null)
            {
                throw new ArgumentNullException("interpreter");
            }

            parent.AddChildContainer(this);

            interpreter.ProcessResource(interpreter.Source, kernel.ConfigurationStore, kernel);

            RunInstaller();
        }
Example #15
0
        public CascadeConfigurationStore(
            IConfigurationInterpreter parent, IConfigurationInterpreter child)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }
            if (child == null)
            {
                throw new ArgumentNullException("child");
            }

            /// The parent configuration add the main entries.
            parent.ProcessResource(parent.Source, this);

            // The child may overwrite the config entries.
            child.ProcessResource(child.Source, this);
        }
Example #16
0
		public PestControlContainer( IConfigurationInterpreter interpreter ) : base(interpreter)
		{
			AddFacility("prevalence", new PrevalenceFacility() );

			// BS Manager

			AddComponent("buildsystemmanager", typeof(BuildSystemManager));

			// Build Systems

			AddComponent("nant", typeof(IBuildSystem), typeof(NAntBuildSystem));
			AddComponent("msbuild", typeof(IBuildSystem), typeof(MSBuildBuildSystem));

			// SC Manager

			AddComponent("sourcecontrolmanager", typeof(SourceControlManager));

			// Source Controls

			AddComponent("svnsc", typeof(ISourceControl), typeof(SvnSourceControl));
			AddComponent("cvssc", typeof(ISourceControl), typeof(CvsSourceControl));
			AddComponent("vsssc", typeof(ISourceControl), typeof(VssSourceControl));
		}
Example #17
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "WindsorContainer" /> class.
        /// </summary>
        /// <param name = "name">The container's name.</param>
        /// <param name = "parent">The parent.</param>
        /// <param name = "interpreter">The interpreter.</param>
        public WindsorContainer(string name, IWindsorContainer parent, IConfigurationInterpreter interpreter) : this()
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }
            if (interpreter == null)
            {
                throw new ArgumentNullException(nameof(interpreter));
            }

            this.name = name;

            parent.AddChildContainer(this);

            interpreter.ProcessResource(interpreter.Source, kernel.ConfigurationStore, kernel);

            RunInstaller();
        }
Example #18
0
        public PestControlContainer(IConfigurationInterpreter interpreter) : base(interpreter)
        {
            AddFacility("prevalence", new PrevalenceFacility());

            // BS Manager

            AddComponent("buildsystemmanager", typeof(BuildSystemManager));

            // Build Systems

            AddComponent("nant", typeof(IBuildSystem), typeof(NAntBuildSystem));
            AddComponent("msbuild", typeof(IBuildSystem), typeof(MSBuildBuildSystem));

            // SC Manager

            AddComponent("sourcecontrolmanager", typeof(SourceControlManager));

            // Source Controls

            AddComponent("svnsc", typeof(ISourceControl), typeof(SvnSourceControl));
            AddComponent("cvssc", typeof(ISourceControl), typeof(CvsSourceControl));
            AddComponent("vsssc", typeof(ISourceControl), typeof(VssSourceControl));
        }
Example #19
0
        public DhtTestBase(IConfigurationInterpreter interpreter)
        {
            EnsureQueueExistsAndIsEmpty("msmq://localhost/dht_test.replication");
            EnsureQueueExistsAndIsEmpty("msmq://localhost/dht_test.replication2");
            EnsureQueueExistsAndIsEmpty("msmq://localhost/dht_test.replication3");

            Delete("cache.esent");
            Delete("cache1.esent");
            Delete("cache2.esent");
            Delete("cache3.esent");
            Delete("test.esent");

            container = new WindsorContainer(interpreter);
            var facility = new RhinoServiceBusFacility();
            bootStrapper = new DhtBootStrapper();
            bootStrapper.ConfigureBusFacility(facility);

            container.Kernel.AddFacility("rhino.esb", facility);

            bus = container.Resolve<IStartableServiceBus>();

            bootStrapper.InitializeContainer(container);

            bus.Start();

            bootStrapper.AfterStart();

            metaDataUrl = new Uri("net.tcp://localhost:8128/dht.metadata");
            client = new DistributedHashTableClient(new Node
            {
                Primary = new NodeUri
                {
                    Sync = metaDataUrl
                }
            });
        }
 public LocationFinder(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     From = new LocationSources(sources, configurationInterpreter);
 }
 public ApplicationContainer(IConfigurationInterpreter interpreter)
     : base(interpreter)
 {
     initialize_ioc();
 }
Example #22
0
 public RhinoContainer(IConfigurationInterpreter interpreter)
     : this(interpreter, null)
 {
 }
 public LocationSources(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     _sources = sources;
     Interpreter = configurationInterpreter;
     Configuration = sources.Configuration;
 }
Example #24
0
 public PostponableContainer(IConfigurationInterpreter interpreter)
     : base(interpreter)
 {
 }
Example #25
0
 internal InternalContainer(IConfigurationInterpreter interpreter)
     : base()
 {
     InitalizeFromConfigurationSource(interpreter);
 }
 public WindsorContainerEx(IConfigurationInterpreter interpreter)
     : base(interpreter)
 {
 }
        /// <summary>
        /// Registers the <see cref="IConfigurationInterpreter"/>.
        /// </summary>
        /// <param name="interpreter">The interpreter.</param>
        public void RegisterInterpreter(IConfigurationInterpreter interpreter)
        {
            Contract.Require.That(interpreter, Is.Not.Null).When("retrieving argument interpreter in RegisterInterpreter method");

            this.interpreter = interpreter;
        }
Example #28
0
 public AsyncInitializationContainer(IConfigurationInterpreter interpreter) : base(interpreter)
 {
 }
 /// <summary>
 /// Constructor that supports one XML config file
 /// </summary>
 /// <param name="interpreter">the wrapper around the config file</param>
 internal PlatformWindsorContainer(IConfigurationInterpreter interpreter)
     : base(interpreter)
 {
 }
        /// <summary>
        /// Registers the <see cref="IConfigurationInterpreter"/>.
        /// </summary>
        /// <param name="interpreter">The interpreter.</param>
        public void RegisterInterpreter(IConfigurationInterpreter interpreter)
        {
            Contract.Require.That(interpreter, Is.Not.Null).When("retrieving argument interpreter in RegisterInterpreter method");

            this.interpreter = interpreter;
        }
Example #31
0
 public RhinoContainer(IConfigurationInterpreter interpreter, IEnvironmentInfo env)
 {
     InitalizeFromConfigurationSource(interpreter, env);
 }
Example #32
0
        private static Configuration LoadAllFilesFromChain(string path, string resourcePostfix, IConfigurationInterpreter interpreter)
        {
            var files = new List <FileInfo>();

            var d = new DirectoryInfo(path);

            do
            {
                var userConfig =
                    d.GetFiles()
                    .Where(r => r.Name.EndsWith(resourcePostfix, StringComparison.OrdinalIgnoreCase))
                    .OrderByDescending(c => c.Name);

                files.AddRange(userConfig);
                d = d.Parent;
            } while (d != null);

            files.Reverse();

            return(files.Select(c => File.ReadAllText(c.FullName))
                   .Aggregate(new Configuration(), (current, resource) =>
            {
                var obj = interpreter.ParseConfiguration(resource);
                return current.UpdateWith(obj);
            }));
        }
Example #33
0
 public LocationSources(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     _sources      = sources;
     Interpreter   = configurationInterpreter;
     Configuration = sources.Configuration;
 }
 private static Configuration GetExpandoFromAssemblies(IEnumerable <Assembly> assemblies, string resourcePostfix, IConfigurationInterpreter interpreter)
 {
     return(assemblies.SelectMany(assembly => ReadEmbededResources(assembly, resourcePostfix)).Aggregate(new Configuration(), (current, resource) =>
     {
         var obj = interpreter.ParseConfiguration(resource);
         return current.UpdateWith(obj);
     }));
 }
Example #35
0
 public LocationFinder(InterpreterSources sources, IConfigurationInterpreter configurationInterpreter)
 {
     From = new LocationSources(sources, configurationInterpreter);
 }