@Inject
public DefaultPersistentBus(final IDBI dbi, final Clock clock, final PersistentBusConfig config, final MetricRegistry metricRegistry) {
super("Bus", Executors.newFixedThreadPool(config.getNbThreads(), new ThreadFactory() {
@Override
public Thread newThread(final Runnable r) {
return new Thread(new ThreadGroup(EVENT_BUS_GROUP_NAME),
r,
EVENT_BUS_TH_NAME);
}
}), config.getNbThreads(), config);
final PersistentBusSqlDao sqlDao = dbi.onDemand(PersistentBusSqlDao.class);
this.clock = clock;
this.dao = new DBBackedQueue<BusEventModelDao>(clock, sqlDao, config, "bus-" + config.getTableName(), metricRegistry);
this.eventBusDelegate = new EventBusDelegate("Killbill EventBus");
this.isStarted = new AtomicBoolean(false);
}