@Inject public InMemoryNotificationBroker(ExecutorService executorService,TimeService timeService,@Named("queueTimeoutMilliseconds") long queueTimeoutMilliseconds,@Named("queueSize") int queueSize){
  Reject.ifNull(executorService,"Executor service must not be null");
  Reject.ifNull(timeService,"Time service must not be null");
  Reject.ifTrue(queueTimeoutMilliseconds < 0,"Queue timeout must be a positive integer");
  Reject.ifTrue(queueSize < 0,"Queue size must be a positive integer");
  this.queueTimeoutMilliseconds=queueTimeoutMilliseconds;
  this.timeService=timeService;
  queue=new ArrayBlockingQueue<>(queueSize);
  subscriptions=new CopyOnWriteArrayList<>();
  readerFuture=executorService.submit(new NotificationReader());
}

@ Inject public InMemoryNotificationBroker ( ExecutorService executorService , TimeService timeService , @ Named ( "queueTimeoutMilliseconds" ) long queueTimeoutMilliseconds , @ Named ( "queueSize" ) int queueSize ) { Reject . ifNull ( executorService , "Executor service must not be null" ) ; Reject . ifNull ( timeService , "Time service must not be null" ) ; Reject . ifTrue ( queueTimeoutMilliseconds < 0 , "Queue timeout must be a positive integer" ) ; Reject . ifTrue ( queueSize < 0 , "Queue size must be a positive integer" ) ; this . queueTimeoutMilliseconds = queueTimeoutMilliseconds ; this . timeService = timeService ; queue = new ArrayBlockingQueue < > ( queueSize ) ; subscriptions = new CopyOnWriteArrayList < > ( ) ; readerFuture = executorService . submit ( new NotificationReader ( ) ) ; }
constructs a new inmemorynotificationbroker .
