Пример #1
0
        private void Configure(IUnityContainer container)
        {
            // инициализируем Environment
            container.RegisterType <IWmsEnvironmentInfoProvider, SvcWmsEnvironmentInfoProvider>(new ContainerControlledLifetimeManager());
            container.RegisterType <ILocalData, ThreadStaticLocalData>(new ContainerControlledLifetimeManager());
            WmsEnvironment.Init(container.Resolve <IWmsEnvironmentInfoProvider>(), container.Resolve <ILocalData>());

            AuthenticateService(container);

            InitEps(container);

            // инициализируем Wf
            WorkflowServicesUnityConfigurator.Configure(container, false);

            // инициализируем job-ы
            container.RegisterType <ISchedulerFactory, CustomSchedulerFactory>(new ContainerControlledLifetimeManager());
            container.RegisterType <IScheduler>(new InjectionFactory(c => c.Resolve <ISchedulerFactory>().GetScheduler()));
            container.RegisterType <IConfigurationProvider, DbConfigurationProvider>();


            // настраиваем fr
            //осознано выставляем этот параметр, чтобы откл. часть функционала
            FastReport.Utils.Config.WebMode = true;
            FastReport.Utils.RegisteredObjects.AddConnection(typeof(FastReport.Data.OracleDataConnection));

            _scheduler = container.Resolve <IScheduler>();
        }
Пример #2
0
        private static void Configure(IUnityContainer container)
        {
            // инициализируем Environment
            container.RegisterType <IWmsEnvironmentInfoProvider, WebWmsEnvironmentInfoProvider>(
                new ContainerControlledLifetimeManager());
            container.RegisterType <ILocalData, WebLocalData>(new ContainerControlledLifetimeManager());
            WmsEnvironment.Init(container.Resolve <IWmsEnvironmentInfoProvider>(), container.Resolve <ILocalData>());

            // запускаем wf
            WorkflowServicesUnityConfigurator.Configure(container, true);

            // настраиваем fr
            FastReport.Utils.Config.WebMode = true;
            RegisteredObjects.AddConnection(typeof(OracleDataConnection));
        }
Пример #3
0
        private static void Configure(IUnityContainer container)
        {
            // регистрируем сервисы
            container.RegisterType <IQueueService, QueueService>();

            // выставляем контейнер для фабрики сервисов
            WcfServiceFactory.SetRootContainer(container);

            // инициализируем Environment
            container.RegisterType <IWmsEnvironmentInfoProvider, SvcWmsEnvironmentInfoProvider>(new ContainerControlledLifetimeManager());
            container.RegisterType <ILocalData, WebLocalData>(new ContainerControlledLifetimeManager());
            WmsEnvironment.Init(container.Resolve <IWmsEnvironmentInfoProvider>(), container.Resolve <ILocalData>());

            // запускаем wf
            WorkflowServicesUnityConfigurator.Configure(container, false);
        }
Пример #4
0
        public void Setup()
        {
            // init log4net
            XmlConfigurator.Configure();

            UnityConfig.RegisterComponents(container =>
            {
                container.RegisterType <IWmsEnvironmentInfoProvider, ManualWmsEnvironmentInfoProvider>(
                    new ContainerControlledLifetimeManager());
                WmsEnvironment.Init(container.Resolve <IWmsEnvironmentInfoProvider>(), null);

                // запускаем wf
                WorkflowServicesUnityConfigurator.Configure(container, false);

                _container = container;
            });
        }