public static void Configure(CassandraSharpConfig config) { config.CheckArgumentNotNull("config"); if (null != _config) { throw new InvalidOperationException("ClusterManager is already initialized"); } _logger = Logger.Factory.Create(config.Logger); _recoveryService = Recovery.Factory.Create(config.Recovery, _logger); _config = config; }
public void Configure(CassandraSharpConfig config) { config.CheckArgumentNotNull("config"); lock (_lock) { if (null != _config) { throw new InvalidOperationException("ClusterManager is already initialized"); } _logger = ServiceActivator<Logger.Factory>.Create<ILogger>(config.Logger.Type, config.Logger); _recoveryService = ServiceActivator<Recovery.Factory>.Create<IRecoveryService>(config.Recovery.Type, config.Recovery, _logger); _instrumentation = ServiceActivator<Instrumentation.Factory>.Create<IInstrumentation>(config.Instrumentation.Type, config.Instrumentation); _config = config; } }