/** * Builds a {@code com.bazaarvoice.ostrich.ServicePool}. * * @return The {@code com.bazaarvoice.ostrich.ServicePool} that was constructed. */ public com.bazaarvoice.ostrich.ServicePool<S> build() { return buildInternal(); }
/** * Builds a {@code com.bazaarvoice.ostrich.ServicePool}. * * @return The {@code com.bazaarvoice.ostrich.ServicePool} that was constructed. */ public com.bazaarvoice.ostrich.ServicePool<S> build() { return buildInternal(); }
/** * Builds a {@code com.bazaarvoice.ostrich.AsyncServicePool}. * * @return The {@code com.bazaarvoice.ostrich.AsyncServicePool} that was constructed. */ public com.bazaarvoice.ostrich.AsyncServicePool<S> buildAsync() { ServicePool<S> pool = buildInternal(); boolean shutdownAsyncExecutorOnClose = (_asyncExecutor == null); if (_asyncExecutor == null) { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(_serviceName + "-AsyncExecutorThread-%d") .setDaemon(true) .build(); _asyncExecutor = Executors.newCachedThreadPool(threadFactory); } return new AsyncServicePool<>(Ticker.systemTicker(), pool, true, _asyncExecutor, shutdownAsyncExecutorOnClose, _metrics); }
/** * Builds a {@code com.bazaarvoice.ostrich.AsyncServicePool}. * * @return The {@code com.bazaarvoice.ostrich.AsyncServicePool} that was constructed. */ public com.bazaarvoice.ostrich.AsyncServicePool<S> buildAsync() { ServicePool<S> pool = buildInternal(); boolean shutdownAsyncExecutorOnClose = (_asyncExecutor == null); if (_asyncExecutor == null) { ThreadFactory threadFactory = new ThreadFactoryBuilder() .setNameFormat(_serviceName + "-AsyncExecutorThread-%d") .setDaemon(true) .build(); _asyncExecutor = Executors.newCachedThreadPool(threadFactory); } return new AsyncServicePool<>(Ticker.systemTicker(), pool, true, _asyncExecutor, shutdownAsyncExecutorOnClose, _metrics); }