public EventPublisher(int queueCapacity, int poolSize, EventRepository er, long submitTimeout) {
final BlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(queueCapacity);
RejectedExecutionHandler rej = new EventRejectedExecutionHandler();
ThreadFactory tFactorty = new PublisherThreadFactory();
this.executor =
new ThreadPoolExecutor(poolSize, poolSize, 0L, TimeUnit.MILLISECONDS, queue, tFactorty, rej);
this.repository = er;
this.submitTimeout = submitTimeout;
this.shutdownExecutor = true;
}