Configuration parameters for YAMS.
Exemplo n.º 1
0
 public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository,
                     IDeploymentStatusWriter deploymentStatusWriter,
                     IUpdateSessionManager updateSessionManager)
 {
     _container = RegisterTypes(config, deploymentRepository, deploymentStatusWriter,
                                updateSessionManager).Build();
 }
Exemplo n.º 2
0
 private static void RegisterApplicationConfigSymbolResolver(ContainerBuilder builder)
 {
     builder.Register <IApplicationConfigSymbolResolver>(c =>
     {
         YamsConfig config = c.Resolve <YamsConfig>();
         return(new ApplicationConfigSymbolResolver(config.ClusterId, config.InstanceId, config.ClusterProperties));
     }).SingleInstance();
 }
Exemplo n.º 3
0
 private static void RegisterApplicationConfigSymbolResolver(IUnityContainer container)
 {
     container.RegisterType <IApplicationConfigSymbolResolver>(new ContainerControlledLifetimeManager(),
                                                               new InjectionFactory(c =>
     {
         YamsConfig config = c.Resolve <YamsConfig>();
         return(new ApplicationConfigSymbolResolver(config.CloudServiceDeploymentId, config.RoleInstanceId));
     }));
 }
Exemplo n.º 4
0
        public static IYamsService Create(YamsConfig yamsConfig, string deploymentRepositoryStorageConnectionString,
            string updateSessionStorageConnectionString)
        {
            IUpdateSessionManager updateSessionManager = new AzureBlobStorageUpdateSessionDiModule(
                yamsConfig.ClusterId,
                yamsConfig.InstanceId,
                yamsConfig.InstanceUpdateDomain,
                updateSessionStorageConnectionString).UpdateSessionManager;

            IDeploymentRepository deploymentRepository = BlobStorageDeploymentRepository.Create(deploymentRepositoryStorageConnectionString);
            return new YamsDiModule(yamsConfig, deploymentRepository, updateSessionManager).YamsService;
        }
Exemplo n.º 5
0
        public static IYamsService Create(YamsConfig yamsConfig, string deploymentRepositoryStorageConnectionString,
                                          string updateSessionStorageConnectionString)
        {
            IUpdateSessionManager updateSessionManager = new AzureBlobStorageUpdateSessionDiModule(
                yamsConfig.ClusterDeploymentId,
                yamsConfig.InstanceId,
                yamsConfig.InstanceUpdateDomain,
                updateSessionStorageConnectionString).UpdateSessionManager;

            IDeploymentRepository deploymentRepository = new BlobStorageDeploymentRepository(deploymentRepositoryStorageConnectionString);

            return(new YamsDiModule(yamsConfig, deploymentRepository, updateSessionManager).YamsService);
        }
Exemplo n.º 6
0
        public static ContainerBuilder RegisterTypes(YamsConfig config,
                                                     IDeploymentRepository deploymentRepository, IDeploymentStatusWriter deploymentStatusWriter,
                                                     IUpdateSessionManager updateSessionManager)
        {
            var builder = new ContainerBuilder();

            RegisterConfig(builder, config);

            RegisterProcessFactory(builder);

            RegisterProcessStopper(builder);

            RegisterApplicationConfigSymbolResolver(builder);

            RegisterApplicationConfigParser(builder);

            RegisterConfigurableApplicationFactory(builder);

            RegisterApplicationDeploymentDirectory(builder);

            RegisterApplicationPool(builder);

            RegisterApplicationInstaller(builder);

            RegisterApplicationDownloader(builder);

            RegisterApplicationUpdateManager(builder);

            RegisterDeploymentWatcher(builder);

            builder.RegisterInstance(updateSessionManager);

            builder.RegisterInstance(deploymentRepository);
            builder.RegisterInstance(deploymentStatusWriter);

            builder.RegisterType <YamsService>().As <IYamsService>().SingleInstance();

            RegisterAppDeploymentMatcher(builder);

            builder.RegisterType <DiagnosticsTraceWriter>().As <ITraceWriter>().SingleInstance();
            builder.RegisterType <JsonSerializer>().As <IJsonSerializer>().SingleInstance();

            builder.RegisterType <Os.System>().As <ISystem>().SingleInstance();

            return(builder);
        }
Exemplo n.º 7
0
        public static ContainerBuilder RegisterTypes(YamsConfig config, 
            IDeploymentRepository deploymentRepository, IUpdateSessionManager updateSessionManager)
        {
            var builder = new ContainerBuilder();

            RegisterConfig(builder, config);

            RegisterProcessFactory(builder);

            RegisterProcessStopper(builder);

            RegisterApplicationConfigSymbolResolver(builder);

            RegisterApplicationConfigParser(builder);

            RegisterConfigurableApplicationFactory(builder);

            RegisterApplicationDeploymentDirectory(builder);

            RegisterApplicationPool(builder);

            RegisterApplicationInstaller(builder);

            RegisterApplicationDownloader(builder);

            RegisterApplicationUpdateManager(builder);

            RegisterDeploymentWatcher(builder);

            builder.RegisterInstance(updateSessionManager);

            builder.RegisterInstance(deploymentRepository);

            builder.RegisterType<YamsService>().As<IYamsService>().SingleInstance();

            RegisterAppDeploymentMatcher(builder);

            builder.RegisterType<DiagnosticsTraceWriter>().As<ITraceWriter>().SingleInstance();
            builder.RegisterType<JsonSerializer>().As<IJsonSerializer>().SingleInstance();

            return builder;
        }
Exemplo n.º 8
0
        public static void RegisterTypes(IUnityContainer container, YamsConfig config)
        {
            RegisterConfig(container, config);

            RegisterCloudStorageAccount(container);

            RegisterCloudBlobClient(container);

            RegisterBlobLeaseFactory(container);

            RegisterBlobLeaseFactory(container);

            RegisterProcessFactory(container);

            RegisterProcessStopper(container);

            RegisterUpdateSessionManager(container);

            RegisterApplicationConfigSymbolResolver(container);

            RegisterApplicationConfigParser(container);

            RegisterConfigurableApplicationFactory(container);

            RegisterUpdateSessionManagerConfig(container);

            RegisterApplicationDeploymentDirectory(container);

            RegisterApplicationPool(container);

            RegisterApplicationInstaller(container);

            RegisterApplicationDownloader(container);

            RegisterApplicationUpdateManager(container);

            RegisterDeploymentWatcher(container);

            RegisterRemoteDirectory(container);
        }
Exemplo n.º 9
0
        public static void RegisterTypes(IUnityContainer container, YamsConfig config)
        {
            RegisterConfig(container, config);

            RegisterCloudStorageAccount(container);

            RegisterCloudBlobClient(container);

            RegisterBlobLeaseFactory(container);

            RegisterBlobLeaseFactory(container);

            RegisterProcessFactory(container);

            RegisterProcessStopper(container);

            RegisterUpdateSessionManager(container);

            RegisterApplicationConfigSymbolResolver(container);

            RegisterApplicationConfigParser(container);

            RegisterConfigurableApplicationFactory(container);

            RegisterUpdateSessionManagerConfig(container);

            RegisterApplicationDeploymentDirectory(container);

            RegisterApplicationPool(container);

            RegisterApplicationInstaller(container);

            RegisterApplicationDownloader(container);

            RegisterApplicationUpdateManager(container);

            RegisterDeploymentWatcher(container);

            RegisterRemoteDirectory(container);
        }
Exemplo n.º 10
0
 private static void RegisterConfig(IUnityContainer container, YamsConfig config)
 {
     container.RegisterInstance(config);
 }
Exemplo n.º 11
0
 public YamsEntryPoint(YamsConfig config) : this(InitializeDefaultUnityContainer(config))
 {
 }
Exemplo n.º 12
0
 public static IUnityContainer InitializeDefaultUnityContainer(YamsConfig config)
 {
     _unityContainer = new UnityContainer();
     DiModule.RegisterTypes(_unityContainer, config);
     return _unityContainer;
 }
Exemplo n.º 13
0
 private static void RegisterConfig(ContainerBuilder builder, YamsConfig config)
 {
     builder.RegisterInstance(config);
 }
Exemplo n.º 14
0
 public static IContainer InitializeDefaultModules(YamsConfig config)
 {
     var builder = new ContainerBuilder();
     DiModule.RegisterTypes(builder, config);
     return builder.Build();
 }
Exemplo n.º 15
0
 public YamsEntryPoint(YamsConfig config) : this(InitializeDefaultModules(config))
 {
 }
Exemplo n.º 16
0
 public static IUnityContainer InitializeDefaultUnityContainer(YamsConfig config)
 {
     _unityContainer = new UnityContainer();
     DiModule.RegisterTypes(_unityContainer, config);
     return(_unityContainer);
 }
Exemplo n.º 17
0
 public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository, 
     IUpdateSessionManager updateSessionManager)
 {
     _container = RegisterTypes(config, deploymentRepository, updateSessionManager).Build();
 }
Exemplo n.º 18
0
 private static void RegisterConfig(IUnityContainer container, YamsConfig config)
 {
     container.RegisterInstance(config);
 }
Exemplo n.º 19
0
 private static void RegisterConfig(ContainerBuilder builder, YamsConfig config)
 {
     builder.RegisterInstance(config);
 }
Exemplo n.º 20
0
 public YamsEntryPoint(YamsConfig config) : this(InitializeDefaultUnityContainer(config))
 {
 }