public override void startup() { base.startup(); if (addressParser == null) { addressParser = new RpcAddressParser(); } ConnectionSelectStrategy connectionSelectStrategy = (ConnectionSelectStrategy)option(BoltGenericOption.CONNECTION_SELECT_STRATEGY); if (connectionSelectStrategy == null) { connectionSelectStrategy = new RandomSelectStrategy(switches()); } connectionManager = new DefaultClientConnectionManager(connectionSelectStrategy, new RpcConnectionFactory(userProcessors, this), connectionEventHandler, connectionEventListener, switches()); connectionManager.AddressParser = addressParser; connectionManager.startup(); rpcRemoting = new RpcClientRemoting(new RpcCommandFactory(), addressParser, connectionManager); taskScanner.add(connectionManager); taskScanner.startup(); if (switches().isOn(GlobalSwitch.CONN_MONITOR_SWITCH)) { if (monitorStrategy == null) { connectionMonitor = new DefaultConnectionMonitor(new ScheduledDisconnectStrategy(), connectionManager); } else { connectionMonitor = new DefaultConnectionMonitor(monitorStrategy, connectionManager); } connectionMonitor.startup(); logger.LogWarning("Switch on connection monitor"); } if (switches().isOn(GlobalSwitch.CONN_RECONNECT_SWITCH)) { reconnectManager = new ReconnectManager(connectionManager); reconnectManager.startup(); connectionEventHandler.Reconnector = reconnectManager; logger.LogWarning("Switch on reconnect manager"); } }
public DefaultServerConnectionManager(ConnectionSelectStrategy connectionSelectStrategy) : base(connectionSelectStrategy) { }
/// <summary> /// Constructor /// </summary> /// <param name="strategy"> ConnectionSelectStrategy </param> public ConnectionPool(ConnectionSelectStrategy strategy) { this.strategy = strategy; connections = new List <Connection>(); asyncCreationDone = true; }
public DefaultClientConnectionManager(ConnectionSelectStrategy connectionSelectStrategy, ConnectionFactory connectionFactory, ConnectionEventHandler connectionEventHandler, ConnectionEventListener connectionEventListener, GlobalSwitch globalSwitch) : base(connectionSelectStrategy, connectionFactory, connectionEventHandler, connectionEventListener, globalSwitch) { }
/// <summary> /// Construct with parameters. /// </summary> /// <param name="connectionSelectStrategy"> connection selection strategy </param> /// <param name="connectionFactory"> connection factory </param> public DefaultConnectionManager(ConnectionSelectStrategy connectionSelectStrategy, ConnectionFactory connectionFactory) : this(connectionSelectStrategy) { this.connectionFactory = connectionFactory; }
/// <summary> /// Construct with parameters. /// </summary> /// <param name="connectionSelectStrategy"> connection selection strategy </param> public DefaultConnectionManager(ConnectionSelectStrategy connectionSelectStrategy) : this() { this.connectionSelectStrategy = connectionSelectStrategy; }
/// <summary> /// Default constructor. /// </summary> public DefaultConnectionManager() { connTasks = new ConcurrentDictionary <string, RunStateRecordedFutureTask>(); healTasks = new ConcurrentDictionary <string, FutureTask>(); connectionSelectStrategy = new RandomSelectStrategy(globalSwitch); }
/// <summary> /// Construct with parameters. /// </summary> /// <param name="connectionSelectStrategy"> connection selection strategy. </param> /// <param name="connectionFactory"> connection factory </param> /// <param name="connectionEventHandler"> connection event handler </param> /// <param name="connectionEventListener"> connection event listener </param> /// <param name="globalSwitch"> global switch </param> public DefaultConnectionManager(ConnectionSelectStrategy connectionSelectStrategy, ConnectionFactory connectionFactory, ConnectionEventHandler connectionEventHandler, ConnectionEventListener connectionEventListener, GlobalSwitch globalSwitch) : this(connectionSelectStrategy, connectionFactory, connectionEventHandler, connectionEventListener) { this.globalSwitch = globalSwitch; }
/// <summary> /// Construct with parameters. /// </summary> /// <param name="connectionSelectStrategy"> connection selection strategy </param> /// <param name="connectionFactory"> connection factory </param> /// <param name="connectionEventHandler"> connection event handler </param> /// <param name="connectionEventListener"> connection event listener </param> public DefaultConnectionManager(ConnectionSelectStrategy connectionSelectStrategy, ConnectionFactory connectionFactory, ConnectionEventHandler connectionEventHandler, ConnectionEventListener connectionEventListener) : this(connectionSelectStrategy, connectionFactory) { this.connectionEventHandler = connectionEventHandler; this.connectionEventListener = connectionEventListener; }