public ApplicationsModule(IApplicationStore store, IApplicationFactory factory) : base("/applications")
        {
            this.RequiresAuthentication();

            Get["/create"] = parameters => {
                return View["create"];
            };

            Post["/create"] = parameters => {
                var model = 
                    this.Bind<ApplicationModel>();

                var application =
                    factory.Create(model);

                store.Add(application);

                return Response.AsRedirect("~/applications/display/" + application.Id.ToString());
            };

            Get["/display/{id}"] = parameters => {
                return View["display", store.First(x => x.Id.ToString().Equals(parameters.id))];
            };

            Get["/list"] = parameters => {
                return View["list", store];
            };
        }
예제 #2
0
        public ApplicationPoolTestFixture()
        {
            var dataRootPath = Path.Combine(Directory.GetCurrentDirectory(), "Data", "ApplicationPool");
            var testDirPath  = Path.Combine(Directory.GetCurrentDirectory(), "ApplicationPoolTest");

            ApplicationsRootPath = Path.Combine(testDirPath, "Applications");

            FileUtils.CopyDir(dataRootPath, ApplicationsRootPath, overwrite: true).Wait();

            const string exeName = "TestProcess.exe";

            string[] testAppsRelPath =
            {
                Path.Combine("test.myapp", "1.0.0"),
                Path.Combine("test.myapp", "1.0.1"),
            };

            foreach (string testAppRelPath in testAppsRelPath)
            {
                TestUtils.CopyExe(exeName, Path.Combine(ApplicationsRootPath, testAppRelPath));
            }

            YamsConfig config = new YamsConfigBuilder("clusterId", "1", "instanceId", "C:\\")
                                .SetShowApplicationProcessWindow(false).SetApplicationRestartCount(0).Build();

            ApplicationFactory =
                new ConfigurableApplicationFactory(new ApplicationConfigParser(
                                                       new ApplicationConfigSymbolResolver(ClusterId, InstanceId), new JsonSerializer(new DiagnosticsTraceWriter())),
                                                   new ProcessFactory(config), new ProcessStopper(0));
        }
예제 #3
0
 public ApplicationInstaller(string applicationsRootPath,
                             IApplicationFactory applicationFactory, IApplicationPool applicationPool)
 {
     _applicationsRootPath = applicationsRootPath;
     _applicationFactory   = applicationFactory;
     _applicationPool      = applicationPool;
 }
예제 #4
0
        public ApplicationPoolTestFixture()
        {
            var dataRootPath = Path.Combine(Directory.GetCurrentDirectory(), "Data", "ApplicationPool");
            var testDirPath  = Path.Combine(Directory.GetCurrentDirectory(), "ApplicationPoolTest");

            ApplicationsRootPath = Path.Combine(testDirPath, "Applications");

            FileUtils.CopyDir(dataRootPath, ApplicationsRootPath, overwrite: true).Wait();

            const string exeName = "TestProcess.exe";

            string[] testAppsRelPath =
            {
                Path.Combine("test.myapp", "1.0.0"),
                Path.Combine("test.myapp", "1.0.1"),
            };

            foreach (string testAppRelPath in testAppsRelPath)
            {
                TestUtils.CopyExe(exeName, Path.Combine(ApplicationsRootPath, testAppRelPath));
            }

            ApplicationFactory =
                new ConfigurableApplicationFactory(new ApplicationConfigParser(new ApplicationConfigSymbolResolver(DeploymentId, InstanceId)),
                                                   new SelfRestartingProcessFactory(0, false), new ProcessStopper(0));
        }
예제 #5
0
        public ApplicationsModule(IApplicationStore store, IApplicationFactory factory) : base("/applications")
        {
            this.RequiresAuthentication();

            Get["/create"] = parameters => {
                return(View["create"]);
            };

            Post["/create"] = parameters => {
                var model =
                    this.Bind <ApplicationModel>();

                var application =
                    factory.Create(model);

                store.Add(application);

                return(Response.AsRedirect("~/applications/display/" + application.Id.ToString()));
            };

            Get["/display/{id}"] = parameters => {
                return(View["display", store.First(x => x.Id.ToString().Equals(parameters.id))]);
            };

            Get["/list"] = parameters => {
                return(View["list", store]);
            };
        }
예제 #6
0
 public ApplicationInstaller(string applicationsRootPath, IUpdateSessionManager updateSessionManager, IApplicationFactory applicationFactory,
     IApplicationPool applicationPool)
 {
     _applicationsRootPath = applicationsRootPath;
     _updateSessionManager = updateSessionManager;
     _applicationFactory = applicationFactory;
     _applicationPool = applicationPool;
 }
예제 #7
0
 public ApplicationInstaller(string applicationsRootPath, IUpdateSessionManager updateSessionManager, IApplicationFactory applicationFactory,
                             IApplicationPool applicationPool)
 {
     _applicationsRootPath = applicationsRootPath;
     _updateSessionManager = updateSessionManager;
     _applicationFactory   = applicationFactory;
     _applicationPool      = applicationPool;
 }
예제 #8
0
 public ApplicationService(IApplicationFactory applicationsFactory, IApplicationStatusService applicationStatusService, IAppIndexerMapService appIndexerMapService, IIndexerFactory indexerFactory, Logger logger)
 {
     _applicationsFactory      = applicationsFactory;
     _applicationStatusService = applicationStatusService;
     _appIndexerMapService     = appIndexerMapService;
     _indexerFactory           = indexerFactory;
     _logger = logger;
 }
예제 #9
0
 public ApplicationOperation(
     ClientContext context,
     IApplicationFactory factory,
     IApplicationMonitor monitor,
     ILogger logger,
     IText text) : base(context)
 {
     this.factory = factory;
     this.monitor = monitor;
     this.logger  = logger;
     this.text    = text;
 }
        public AppExtractionCommand(IEnumerable<IPackageExtractor> extractors, 
            IInstanceConfiguration config,
            IApplicationFactory appFactory, 
            IInstallationRoot installRoot)
        {
            _appFactory = appFactory;
            _installRoot = installRoot;
            _extractors = extractors.ToList();
            _config = config;

            _installRoot.EnsureInstallationDirectoryExists();
        }
        public AppExtractionCommand(IEnumerable <IPackageExtractor> extractors,
                                    IInstanceConfiguration config,
                                    IApplicationFactory appFactory,
                                    IInstallationRoot installRoot,
                                    IEnumerable <IEnvironmentApplier> configurators,
                                    TextWriter output,
                                    IFileSystem fs)
        {
            _appFactory    = appFactory;
            _installRoot   = installRoot;
            _configurators = configurators;
            _output        = output;
            _fs            = fs;
            _extractors    = extractors.ToList();
            _config        = config;

            _installRoot.EnsureInstallationDirectoryExists();
        }
예제 #12
0
 public EventBuildingBlockCreator(IObjectBaseFactory objectBaseFactory,
                                  IProtocolToSchemaItemsMapper schemaItemsMapper,
                                  IApplicationFactory applicationFactory,
                                  IFormulationFromMappingRetriever formulationFromMappingRetriever,
                                  ICloneManagerForBuildingBlock cloneManagerForBuildingBlock,
                                  IParameterIdUpdater parameterIdUpdater,
                                  IParameterSetUpdater parameterSetUpdater,
                                  IEventGroupRepository eventGroupRepository)
 {
     _objectBaseFactory  = objectBaseFactory;
     _schemaItemsMapper  = schemaItemsMapper;
     _applicationFactory = applicationFactory;
     _formulationFromMappingRetriever = formulationFromMappingRetriever;
     _cloneManagerForBuildingBlock    = cloneManagerForBuildingBlock;
     _parameterIdUpdater   = parameterIdUpdater;
     _parameterSetUpdater  = parameterSetUpdater;
     _eventGroupRepository = eventGroupRepository;
 }
예제 #13
0
        public void Initialize()
        {
            FileUtils.CopyDir(_dataRootPath, _applicationsRootPath, overwrite: true).Wait();

            const string exeName = "TestProcess.exe";
            string[] testAppsRelPath =
            {
                Path.Combine("test.myapp", "1.0.0"),
                Path.Combine("test.myapp", "1.0.1"),
            };

            foreach (string testAppRelPath in testAppsRelPath)
            {
                TestUtils.CopyExe(exeName, Path.Combine(_applicationsRootPath, testAppRelPath));
            }

            _applicationFactory =
                new ConfigurableApplicationFactory(new ApplicationConfigParser(new ApplicationConfigSymbolResolver(DeploymentId, InstanceId)),
                    new SelfRestartingProcessFactory(0), new ProcessStopper(0));
            _applicationPool = new ApplicationPool();
        }
예제 #14
0
        public void Initialize()
        {
            FileUtils.CopyDir(_dataRootPath, _applicationsRootPath, overwrite: true).Wait();

            const string exeName = "TestProcess.exe";

            string[] testAppsRelPath =
            {
                Path.Combine("test.myapp", "1.0.0"),
                Path.Combine("test.myapp", "1.0.1"),
            };

            foreach (string testAppRelPath in testAppsRelPath)
            {
                TestUtils.CopyExe(exeName, Path.Combine(_applicationsRootPath, testAppRelPath));
            }

            _applicationFactory =
                new ConfigurableApplicationFactory(new ApplicationConfigParser(new ApplicationConfigSymbolResolver(DeploymentId, InstanceId)),
                                                   new SelfRestartingProcessFactory(0), new ProcessStopper(0));
            _applicationPool = new ApplicationPool();
        }
예제 #15
0
 public ViewMemoryTracesCommand(IAppMainView view, IApplicationFactory factory, IReadableRepository memoryRepository)
 {
     this.view             = view;
     this.factory          = factory;
     this.memoryRepository = memoryRepository;
 }
예제 #16
0
 public ViewDatabaseTracesCommand(IAppMainView view, IApplicationFactory factory)
 {
     this.view    = view;
     this.factory = factory;
 }
예제 #17
0
 public ApplicationStatusCheck(IApplicationFactory providerFactory, IApplicationStatusService providerStatusService, ILocalizationService localizationService)
     : base(localizationService)
 {
     _providerFactory       = providerFactory;
     _providerStatusService = providerStatusService;
 }
예제 #18
0
 public ApplicationPoolTest(ApplicationPoolTestFixture fixture)
 {
     _applicationPool      = new ApplicationPool();
     _applicationFactory   = fixture.ApplicationFactory;
     _applicationsRootPath = fixture.ApplicationsRootPath;
 }
 public ApplicationService(SystemDataContext context, IApplicationFactory factory, IUserService userService)
 {
     _context     = context;
     _factory     = factory;
     _userService = userService;
 }
 public ViewInstrumentationCommand(IAppMainView view, IApplicationFactory factory)
 {
     this.view    = view;
     this.factory = factory;
 }