/// <summary>
        /// Creates a new instance of the service class.
        /// </summary>
        /// <param name="clusterOperator"></param>
        /// <param name="mailer"></param>
        /// <param name="stateManager"></param>
        /// <param name="serviceParameters"></param>
        /// <param name="config"></param>
        public ClusterService(
            IClusterOperator clusterOperator,
            ISendMail mailer,
            IApplicationDeployService applicationDeployService,
            IReliableStateManager stateManager,
            StatefulServiceParameters serviceParameters,
            ClusterConfig config)
        {
            this.config = config;
            this.clusterOperator = clusterOperator;
            this.applicationDeployService = applicationDeployService;
            this.mailer = mailer;
            this.StateManager = stateManager;
            this.serviceParameters = serviceParameters;

            this.ConfigureService();
        }
        private void UpdateClusterConfigSettings(ConfigurationSettings settings)
        {
            KeyedCollection<string, ConfigurationProperty> clusterConfigParameters = settings.Sections["ClusterConfigSettings"].Parameters;

            this.config = new ClusterConfig();
            this.config.RefreshInterval = TimeSpan.Parse(clusterConfigParameters["RefreshInterval"].Value);
            this.config.MinimumClusterCount = Int32.Parse(clusterConfigParameters["MinimumClusterCount"].Value);
            this.config.MaximumClusterCount = Int32.Parse(clusterConfigParameters["MaximumClusterCount"].Value);
            this.config.MaximumUsersPerCluster = Int32.Parse(clusterConfigParameters["MaximumUsersPerCluster"].Value);
            this.config.MaximumClusterUptime = TimeSpan.Parse(clusterConfigParameters["MaximumClusterUptime"].Value);
            this.config.UserCapacityHighPercentThreshold = Double.Parse(clusterConfigParameters["UserCapacityHighPercentThreshold"].Value);
            this.config.UserCapacityLowPercentThreshold = Double.Parse(clusterConfigParameters["UserCapacityLowPercentThreshold"].Value);
        }