ConnectionThrottler(Runtime runtime, RateStatistic rateStatistic, Scheduler scheduler, AbstractConnector connector, ConnectorConfig.Throttling config) { this.connector = connector; if (config.maxHeapUtilization() != -1) { this.resourceLimits.add(new HeapResourceLimit(runtime, config.maxHeapUtilization())); } if (config.maxConnections() != -1) { this.resourceLimits.add(new ConnectionLimitThreshold(config.maxConnections())); } if (config.maxAcceptRate() != -1) { this.resourceLimits.add(new AcceptRateLimit(rateStatistic, config.maxAcceptRate())); } this.idleTimeout = config.idleTimeout() != -1 ? Duration.ofMillis((long) (config.idleTimeout()*1000)) : null; this.scheduler = scheduler; }