当前位置: 首页>>代码示例>>C#>>正文


C# Config.GetBoolean方法代码示例

本文整理汇总了C#中Akka.Configuration.Config.GetBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# Config.GetBoolean方法的具体用法?C# Config.GetBoolean怎么用?C# Config.GetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Akka.Configuration.Config的用法示例。


在下文中一共展示了Config.GetBoolean方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RemoteSettings

 public RemoteSettings(Config config)
 {
     Config = config;
     LogReceive = config.GetBoolean("akka.remote.log-received-messages");
     LogSend = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
     if (RemoteLifecycleEventsLogLevel.Equals("on")) RemoteLifecycleEventsLogLevel = "DEBUG";
     FlushWait = config.GetMillisDuration("akka.remote.flush-wait-on-shutdown");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames = config.GetStringList("akka.remote.enabled-transports");
     Transports = (from transportName in TransportNames
         let transportConfig = TransportConfigFor(transportName)
         select new TransportSettings(transportConfig)).ToArray();
     Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));
     BackoffPeriod = config.GetMillisDuration("akka.remote.backoff-interval");
     RetryGateClosedFor = config.GetMillisDuration("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
     UsePassiveConnections = config.GetBoolean("akka.remote.use-passive-connections");
     SysMsgBufferSize = config.GetInt("akka.remote.system-message-buffer-size");
     SysResendTimeout = config.GetMillisDuration("akka.remote.resend-interval");
     InitialSysMsgDeliveryTimeout = config.GetMillisDuration("akka.remote.initial-system-message-delivery-timeout");
     SysMsgAckTimeout = config.GetMillisDuration("akka.remote.system-message-ack-piggyback-timeout");
     QuarantineDuration = config.GetMillisDuration("akka.remote.prune-quarantine-marker-after");
     StartupTimeout = config.GetMillisDuration("akka.remote.startup-timeout");
     CommandAckTimeout = config.GetMillisDuration("akka.remote.command-ack-timeout");
 }
开发者ID:jweimann,项目名称:akka.net,代码行数:27,代码来源:RemoteSettings.cs

示例2: RemoteSettings

 public RemoteSettings(Config config)
 {
     Config = config;
     LogReceive = config.GetBoolean("akka.remote.log-received-messages");
     LogSend = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames = config.GetStringList("akka.remote.enabled-transports");
     Transports = (from transportName in TransportNames
         let transportConfig = TransportConfigFor(transportName)
         select new TransportSettings(transportConfig)).ToArray();
 }
开发者ID:Badmoonz,项目名称:akka.net,代码行数:14,代码来源:RemoteSettings.cs

示例3: RemoteSettings

        public RemoteSettings(Config config)
        {
            //TODO: need to add value validation for each field
            Config = config;
            LogReceive = config.GetBoolean("akka.remote.log-received-messages");
            LogSend = config.GetBoolean("akka.remote.log-sent-messages");

            var bufferSizeLogKey = "akka.remote.log-buffer-size-exceeding";
            if (config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("off") ||
                config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("false"))
            {
                LogBufferSizeExceeding = Int32.MaxValue;
            }
            else
            {
                LogBufferSizeExceeding = config.GetInt(bufferSizeLogKey);
            }

            UntrustedMode = config.GetBoolean("akka.remote.untrusted-mode");
            TrustedSelectionPaths = new HashSet<string>(config.GetStringList("akka.remote.trusted-selection-paths"));
            RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
            Dispatcher = config.GetString("akka.remote.use-dispatcher");
            if (RemoteLifecycleEventsLogLevel.Equals("on", StringComparison.OrdinalIgnoreCase)) RemoteLifecycleEventsLogLevel = "DEBUG";
            FlushWait = config.GetTimeSpan("akka.remote.flush-wait-on-shutdown");
            ShutdownTimeout = config.GetTimeSpan("akka.remote.shutdown-timeout");
            TransportNames = config.GetStringList("akka.remote.enabled-transports");
            Transports = (from transportName in TransportNames
                let transportConfig = TransportConfigFor(transportName)
                select new TransportSettings(transportConfig)).ToArray();
            Adapters = ConfigToMap(config.GetConfig("akka.remote.adapters"));
            BackoffPeriod = config.GetTimeSpan("akka.remote.backoff-interval");
            RetryGateClosedFor = config.GetTimeSpan("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
            UsePassiveConnections = config.GetBoolean("akka.remote.use-passive-connections");
            SysMsgBufferSize = config.GetInt("akka.remote.system-message-buffer-size");
            SysResendTimeout = config.GetTimeSpan("akka.remote.resend-interval");
            SysResendLimit = config.GetInt("akka.remote.resend-limit");
            InitialSysMsgDeliveryTimeout = config.GetTimeSpan("akka.remote.initial-system-message-delivery-timeout");
            QuarantineSilentSystemTimeout = config.GetTimeSpan("akka.remote.quarantine-after-silence");
            SysMsgAckTimeout = config.GetTimeSpan("akka.remote.system-message-ack-piggyback-timeout");
            QuarantineDuration = config.GetTimeSpan("akka.remote.prune-quarantine-marker-after");

            StartupTimeout = config.GetTimeSpan("akka.remote.startup-timeout");
            CommandAckTimeout = config.GetTimeSpan("akka.remote.command-ack-timeout");

            WatchFailureDetectorConfig = config.GetConfig("akka.remote.watch-failure-detector");
            WatchFailureDetectorImplementationClass = WatchFailureDetectorConfig.GetString("implementation-class");
            WatchHeartBeatInterval = WatchFailureDetectorConfig.GetTimeSpan("heartbeat-interval");
            WatchUnreachableReaperInterval = WatchFailureDetectorConfig.GetTimeSpan("unreachable-nodes-reaper-interval");
            WatchHeartbeatExpectedResponseAfter = WatchFailureDetectorConfig.GetTimeSpan("expected-response-after");
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:50,代码来源:RemoteSettings.cs

示例4: SessionSettings

        public SessionSettings(Config config)
        {
            if (config == null) throw new ArgumentNullException("config");

            Builder = Cluster.Builder();
            
            // Get IP and port configuration
            int port = config.GetInt("port", 9042);
            IPEndPoint[] contactPoints = ParseContactPoints(config.GetStringList("contact-points"), port);
            Builder.AddContactPoints(contactPoints);

            // Support user/pass authentication
            if (config.HasPath("credentials"))
                Builder.WithCredentials(config.GetString("credentials.username"), config.GetString("credentials.password"));

            // Support SSL
            if (config.GetBoolean("ssl"))
                Builder.WithSSL();

            // Support compression
            string compressionTypeConfig = config.GetString("compression");
            if (compressionTypeConfig != null)
            {
                var compressionType = (CompressionType) Enum.Parse(typeof (CompressionType), compressionTypeConfig, true);
                Builder.WithCompression(compressionType);
            }
        }
开发者ID:aachinfiev,项目名称:Akka.Persistence.Cassandra,代码行数:27,代码来源:SessionSettings.cs

示例5: FromConfig

 public static ClusterRouterGroupSettings FromConfig(Config config)
 {
     return new ClusterRouterGroupSettings(
         GetMaxTotalNrOfInstances(config),
         ImmutableHashSet.Create(config.GetStringList("routees.paths").ToArray()),
         config.GetBoolean("cluster.allow-local-routees"),
         UseRoleOption(config.GetString("cluster.use-role")));
 }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:8,代码来源:ClusterRoutingConfig.cs

示例6: CassandraSettings

        protected CassandraSettings(Config config)
        {
            SessionKey = config.GetString("session-key");

            Keyspace = config.GetString("keyspace");
            KeyspaceCreationOptions = config.GetString("keyspace-creation-options");
            KeyspaceAutocreate = config.GetBoolean("keyspace-autocreate");

            Table = config.GetString("table");
            TableCreationProperties = config.GetString("table-creation-properties");

            // Quote keyspace and table if necessary
            if (config.GetBoolean("use-quoted-identifiers"))
            {
                Keyspace = string.Format("\"{0}\"", Keyspace);
                Table = string.Format("\"{0}\"", Keyspace);
            }

            ReadConsistency = (ConsistencyLevel) Enum.Parse(typeof(ConsistencyLevel), config.GetString("read-consistency"), true);
            WriteConsistency = (ConsistencyLevel) Enum.Parse(typeof(ConsistencyLevel), config.GetString("write-consistency"), true);
        }
开发者ID:njannink,项目名称:sonarlint-vs,代码行数:21,代码来源:CassandraSettings.cs

示例7: JournalSettings

        public JournalSettings(Config config)
        {
            if (config == null) throw new ArgumentNullException("config", "SqlServer journal settings cannot be initialized, because required HOCON section couldn't been found");

            ConnectionString = config.GetString("connection-string");
            ConnectionStringName = config.GetString("connection-string-name");
            ConnectionTimeout = config.GetTimeSpan("connection-timeout");
            SchemaName = config.GetString("schema-name");
            JournalTableName = config.GetString("table-name");
            MetaTableName = config.GetString("metadata-table-name");
            TimestampProvider = config.GetString("timestamp-provider");
            AutoInitialize = config.GetBoolean("auto-initialize");
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:13,代码来源:Settings.cs

示例8: FromConfig

 public static DefaultResizer FromConfig(Config resizerConfig)
 {
     return resizerConfig.GetBoolean("resizer.enabled") ? new DefaultResizer(resizerConfig.GetConfig("resizer")) : null;
 }
开发者ID:rmiller1971,项目名称:akka.net,代码行数:4,代码来源:Resizer.cs

示例9: FromConfig

 public static ClusterRouterPoolSettings FromConfig(Config config)
 {
     return new ClusterRouterPoolSettings(config.GetInt("nr-of-instances"), config.GetBoolean("cluster.allow-local-routees"), config.GetString("cluster.use-role"), config.GetInt("cluster.max-nr-of-instances-per-node"));
 }
开发者ID:rodrigovidal,项目名称:akka.net,代码行数:4,代码来源:ClusterRoutingConfig.cs

示例10: Create

        public static ClusterShardingSettings Create(Config config, Config singletonConfig)
        {
            var tuningParameters = new TunningParameters(
                coordinatorFailureBackoff: config.GetTimeSpan("coordinator-failure-backoff"),
                retryInterval: config.GetTimeSpan("retry-interval"),
                bufferSize: config.GetInt("buffer-size"),
                handOffTimeout: config.GetTimeSpan("handoff-timeout"),
                shardStartTimeout: config.GetTimeSpan("shard-start-timeout"),
                shardFailureBackoff: config.GetTimeSpan("shard-failure-backoff"),
                entityRestartBackoff: config.GetTimeSpan("entity-restart-backoff"),
                rebalanceInterval: config.GetTimeSpan("rebalance-interval"),
                snapshotAfter: config.GetInt("snapshot-after"),
                leastShardAllocationRebalanceThreshold: config.GetInt("least-shard-allocation-strategy.rebalance-threshold"),
                leastShardAllocationMaxSimultaneousRebalance: config.GetInt("least-shard-allocation-strategy.max-simultaneous-rebalance"));

            var coordinatorSingletonSettings = ClusterSingletonManagerSettings.Create(singletonConfig);
            var role = config.GetString("role");
            if (role == string.Empty) role = null;

            return new ClusterShardingSettings(
                role: role,
                rememberEntities: config.GetBoolean("remember-entities"),
                journalPluginId: config.GetString("journal-plugin-id"),
                snapshotPluginId: config.GetString("snapshot-plugin-id"),
                tunningParameters: tuningParameters,
                coordinatorSingletonSettings: coordinatorSingletonSettings);
        }
开发者ID:yaozd,项目名称:akka.net,代码行数:27,代码来源:ClusterShardingSettings.cs

示例11: SnapshotStoreSettings

        public SnapshotStoreSettings(Config config)
        {
            if (config == null) throw new ArgumentNullException("config", "SqlServer snapshot store settings cannot be initialized, because required HOCON section couldn't been found");

            ConnectionString = config.GetString("connection-string");
            ConnectionStringName = config.GetString("connection-string-name");
            ConnectionTimeout = config.GetTimeSpan("connection-timeout");
            SchemaName = config.GetString("schema-name");
            TableName = config.GetString("table-name");
            AutoInitialize = config.GetBoolean("auto-initialize");
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:11,代码来源:Settings.cs

示例12: CreateCouchBaseDBClientConfiguration

        protected void CreateCouchBaseDBClientConfiguration(Config config)
        {
            if(config.GetBoolean("UseClusterHelper"))
            {
                BucketName = config.GetString("BucketName");
                CBClientConfiguration = ClusterHelper.GetBucket(BucketName).Cluster.Configuration;
                UseClusterHelper = true;
            }
            else
            {
                CBClientConfiguration = new ClientConfiguration();

                // Reset the serializers and deserializers so that JSON is stored as PascalCase instead of camelCase
                CBClientConfiguration.Serializer = () => new DefaultSerializer(new JsonSerializerSettings(), new JsonSerializerSettings());
                CBClientConfiguration.Servers.RemoveAt(0);

                //Get the URI's from the HOCON config
                try
                {
                    if (config.GetStringList("ServersURI").Count > 0)
                    {
                        List<Uri> uris = new List<Uri>();
                        foreach (string s in config.GetStringList("ServersURI"))
                        {
                            CBClientConfiguration.Servers.Add(new Uri(s));
                        }
                    }


                }
                catch (Exception ex)
                {
                    throw new Exception("Invalid URI specified in HOCON configuration", ex);
                }

                // Use SSL?
                CBClientConfiguration.UseSsl = config.GetBoolean("UseSSL");

                // This will not be needed since we are not creating a bucket on the fly.
                //AdminPassword = config.GetString("AdminPassword");
                //AdminUserName = config.GetString("AdminUserName");


                // Get the bucket(s) configuration
                Dictionary<string, BucketConfiguration> BucketConfigs = new Dictionary<string, BucketConfiguration>();
                BucketConfiguration newBC = new BucketConfiguration();


                newBC.UseSsl = config.GetBoolean("BucketUseSSL");
                newBC.Password = config.GetString("Password");
                newBC.DefaultOperationLifespan = (uint)config.GetInt("DefaultOperationLifespan");
                BucketName = config.GetString("BucketName");
                newBC.BucketName = BucketName;
                newBC.PoolConfiguration.MinSize = config.GetInt("PoolConfiguration.MinSize");
                newBC.PoolConfiguration.MaxSize = config.GetInt("PoolConfiguration.MaxSize");

                // Create the bucket config specified in the HOCON
                BucketConfigs.Add(newBC.BucketName, newBC);
                CBClientConfiguration.BucketConfigs = BucketConfigs;

            }
        }
开发者ID:akkadotnet,项目名称:Akka.Persistence.CouchBase,代码行数:62,代码来源:CouchDBSettings.cs

示例13: ParseConfig

        public override Deploy ParseConfig(string key, Config config)
        {
            Config config2 = config;
            if (config.HasPath("cluster.enabled")
                && config.GetBoolean("cluster.enabled")
                && !config.HasPath("nr-of-instances"))
            {
                var maxTotalNrOfInstances = config
                    .WithFallback(Default)
                    .GetInt("cluster.max-total-nr-of-instances");
                config2 = ConfigurationFactory.ParseString("nr-of-instances=" + maxTotalNrOfInstances)
                    .WithFallback(config);
            }

            var deploy = base.ParseConfig(key, config2);
            if (deploy != null)
            {
                if (deploy.Config.GetBoolean("cluster.enabled"))
                {
                    if (deploy.Scope != Deploy.NoScopeGiven)
                        throw new ConfigurationException(string.Format("Cluster deployment can't be combined with scope [{0}]", deploy.Scope));
                    if (deploy.RouterConfig is RemoteRouterConfig)
                        throw new ConfigurationException(string.Format("Cluster deployment can't be combined with [{0}]", deploy.Config));

                    if (deploy.RouterConfig is Pool)
                    {
                        return
                            deploy.WithScope(scope: ClusterScope.Instance)
                                .WithRouterConfig(new ClusterRouterPool(deploy.RouterConfig as Pool,
                                    ClusterRouterPoolSettings.FromConfig(deploy.Config)));
                    }
                    else if (deploy.RouterConfig is Group)
                    {
                        return
                            deploy.WithScope(scope: ClusterScope.Instance)
                                .WithRouterConfig(new ClusterRouterGroup(deploy.RouterConfig as Group,
                                    ClusterRouterGroupSettings.FromConfig(deploy.Config)));
                    }
                    else
                    {
                        throw new ArgumentException(string.Format("Cluster-aware router can only wrap Pool or Group, got [{0}]", deploy.RouterConfig.GetType()));
                    }
                }
                else
                {
                    return deploy;
                }
            }
            else
            {
                return null;
            }
        }
开发者ID:Micha-kun,项目名称:akka.net,代码行数:53,代码来源:ClusterActorRefProvider.cs


注:本文中的Akka.Configuration.Config.GetBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。