예제 #1
0
        public void Start(Boolean autoStartJobs = true)
        {
            _container = new WindsorContainer();
            if (autoStartJobs)
            {
                _container.AddFacility <StartableFacility>();
            }

            _container.AddFacility <LoggingFacility>(f =>
                                                     f.LogUsing(LoggerImplementation.ExtendedLog4net)
                                                     .WithConfig("log4net.config"));

            _logger = _container.Resolve <ILogger>();

            ConfigurationServiceSettingsConfiguration config = new ConfigurationServiceSettingsConfiguration();

            //Register only the configuration and the backup jobs.
            _container.Register(
                Component
                .For <Configuration>()
                .Instance(config),
                Component
                .For <DocumentStoreBackupJob>()
                );
        }
예제 #2
0
        public void Start(Boolean autoStartJobs = true)
        {
            _container = new WindsorContainer();
            if (autoStartJobs)
            {
                _container.AddFacility <StartableFacility>();
            }

            _container.AddFacility <LoggingFacility>(f =>
                                                     f.LogUsing(LoggerImplementation.ExtendedLog4net)
                                                     .WithConfig("log4net.config"));

            ConfigurationServiceSettingsConfiguration config = new ConfigurationServiceSettingsConfiguration();

            _container.Register(
                Component.For <Func <IMongoDatabase, ICommitReader> >()
                .Instance(d => new PlainCommitMongoReader(d)),
                Component.For <Func <String, Int64, ICommitWriter> >()
                .Instance((directory, fileSize) => new PlainTextFileCommitWriter(directory, fileSize)),
                Component
                .For <Configuration>()
                .Instance(config),
                Component
                .For <BackupJob>(),
                Component
                .For <RestoreJob>()
                );
        }