public override BoltConnection NewConnection(BoltChannel channel, BoltStateMachine stateMachine)
        {
            requireNonNull(channel);
            requireNonNull(stateMachine);

            BoltScheduler              scheduler              = _schedulerProvider.get(channel);
            BoltConnectionReadLimiter  readLimiter            = CreateReadLimiter(_config, _logService);
            BoltConnectionQueueMonitor connectionQueueMonitor = new BoltConnectionQueueMonitorAggregate(scheduler, readLimiter);
            ChunkedOutput              chunkedOutput          = new ChunkedOutput(channel.RawChannel(), _throttleGroup);

            BoltConnection connection;

            if (_monitors.hasListeners(typeof(BoltConnectionMetricsMonitor)))
            {
                connection = new MetricsReportingBoltConnection(channel, chunkedOutput, stateMachine, _logService, scheduler, connectionQueueMonitor, _metricsMonitor, _clock);
            }
            else
            {
                connection = new DefaultBoltConnection(channel, chunkedOutput, stateMachine, _logService, scheduler, connectionQueueMonitor);
            }

            connection.Start();

            return(connection);
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCallDrainedOnSingleMonitor()
        public virtual void ShouldCallDrainedOnSingleMonitor()
        {
            ICollection <Job>                   batch            = new List <Job>();
            BoltConnectionQueueMonitor          monitor          = mock(typeof(BoltConnectionQueueMonitor));
            BoltConnectionQueueMonitorAggregate monitorAggregate = new BoltConnectionQueueMonitorAggregate(monitor);

            monitorAggregate.Drained(_connection, batch);

            verify(monitor).drained(_connection, batch);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCallEnqueuedOnSingleMonitor()
        public virtual void ShouldCallEnqueuedOnSingleMonitor()
        {
            Job job = mock(typeof(Job));
            BoltConnectionQueueMonitor          monitor          = mock(typeof(BoltConnectionQueueMonitor));
            BoltConnectionQueueMonitorAggregate monitorAggregate = new BoltConnectionQueueMonitorAggregate(monitor);

            monitorAggregate.Enqueued(_connection, job);

            verify(monitor).enqueued(_connection, job);
        }