Exemplo n.º 1
0
        public AWSComputeEnvironmentService(GNEntityModelContainer db)
            : base(db)
        {
            base.db = db;

            AWSConfig awsConfig = db.AWSConfigs.FirstOrDefault();

            cloudComputeService    = new GNCloudComputeService(awsConfig.Id);
            analysisRequestService = new AnalysisRequestService(db, new Data.IdentityModel.IdentityModelContainer());
        }
Exemplo n.º 2
0
        private void InitServices()
        {
            LogUtil.LogMethod(logger, MethodBase.GetCurrentMethod());

            //get mark analysis in error feature setting
            bool.TryParse(
                System.Configuration.ConfigurationManager.AppSettings["MarkAnalysisInErrorFeatureActive"],
                out MARK_ANALYSIS_IN_ERROR_FEATURE_ACTIVE);

            //get restart feature setting
            bool.TryParse(
                System.Configuration.ConfigurationManager.AppSettings["TerminateInstanceFeatureActive"],
                out TERMINATE_INSTANCE_FEATURE_ACTIVE);

            //get restart feature setting
            bool.TryParse(
                System.Configuration.ConfigurationManager.AppSettings["RestartAnalysisFeatureActive"],
                out RESTART_ANALYSIS_FEATURE_ACTIVE);

            //get force restart feature setting
            bool.TryParse(
                System.Configuration.ConfigurationManager.AppSettings["ForceRestartAnalysis"],
                out FORCE_RESTART_ANALYSIS);

            if (cloudComputeService == null)
            {
                LogUtil.Info(logger, GetType().Name + ".InitServices()...");
                System.Console.WriteLine("\n" + GetType().Name + ".InitServices()...");

                try
                {
                    AWSConfig awsConfig = new GNEntityModelContainer().AWSConfigs.FirstOrDefault();
                    cloudComputeService = new GNCloudComputeService(awsConfig.Id);
                }
                catch (Exception ex)
                {
                    LogUtil.Warn(logger, ex.Message, ex);
                    System.Console.WriteLine(ex.Message);
                }
            }
        }