/** * Configures a {@link NettyHttpService.Builder} based on the given arguments. * * @param args the arguments to use for looking up http service configurations * @param builder a {@link NettyHttpService.Builder} to configure * @param <T> type of the {@link NettyHttpService.Builder} * @return the builder instance as provided through the {@code builder} argument */ public static <T extends NettyHttpService.Builder> T configureNettyHttpService(Map<String, String> args, T builder) { Integer threads = getInt(args, SERVICE_THREADS, "http service executor thread pool size"); if (threads != null) { builder.setExecThreadPoolSize(threads); } Long keepAliveSecs = getLong(args, SERVICE_THREAD_KEEPALIVE_SECS, "http service executor keep alive seconds"); if (keepAliveSecs != null) { builder.setExecThreadKeepAliveSeconds(keepAliveSecs); } return builder; }
/** * Configures a {@link NettyHttpService.Builder} based on the given arguments. * * @param args the arguments to use for looking up http service configurations * @param builder a {@link NettyHttpService.Builder} to configure * @param <T> type of the {@link NettyHttpService.Builder} * @return the builder instance as provided through the {@code builder} argument */ public static <T extends NettyHttpService.Builder> T configureNettyHttpService(Map<String, String> args, T builder) { Integer threads = getInt(args, SERVICE_THREADS, "http service executor thread pool size"); if (threads != null) { builder.setExecThreadPoolSize(threads); } Long keepAliveSecs = getLong(args, SERVICE_THREAD_KEEPALIVE_SECS, "http service executor keep alive seconds"); if (keepAliveSecs != null) { builder.setExecThreadKeepAliveSeconds(keepAliveSecs); } return builder; }