* @param svc - the <tt>ErraiService</tt> that is to be associated to this factory of workers
*/
public WorkerFactory(ErraiService svc) {
this.svc = svc;
ErraiServiceConfigurator cfg = svc.getConfiguration();
if (cfg.hasProperty(CONFIG_ASYNC_DELIVERY_QUEUE_SIZE)) {
deliveryQueueSize = Integer.parseInt(cfg.getProperty(CONFIG_ASYNC_DELIVERY_QUEUE_SIZE));
}
if (cfg.hasProperty(CONFIG_ASYNC_THREAD_POOL_SIZE)) {
poolSize = Integer.parseInt(cfg.getProperty(CONFIG_ASYNC_THREAD_POOL_SIZE));
}
if (cfg.hasProperty(CONFIG_ASYNC_WORKER_TIMEOUT)) {
workerTimeout = seconds(Integer.parseInt(cfg.getProperty(CONFIG_ASYNC_WORKER_TIMEOUT)));
}
this.messages = new ArrayBlockingQueue<Message>(deliveryQueueSize);
log.info("initializing async worker pools (poolSize: " + poolSize + "; workerTimeout: " + workerTimeout + ")");