@Test public void shouldReturnExpectedValueForSelector() { ThreadPoolConfig tpc = GrizzlyUtils.getSelectorPoolCfg(IoStrategy.SAME_THREAD, "aService", GrizzlyUtils.MIN_SELECTORS + 1); assertEquals("Must return provided value", GrizzlyUtils.MIN_SELECTORS + 1, tpc.getMaxPoolSize()); }
public static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize) { checkArgument(poolSize >= 0, "Negative thread pool size"); final int threadPoolSize = poolSize > 0 ? Math.max(poolSize, MIN_SELECTORS) : getSelectorPoolSize(ioStrategy); final ThreadPoolConfig poolCfg = ThreadPoolConfig.defaultConfig(); poolCfg.setCorePoolSize(threadPoolSize).setMaxPoolSize(threadPoolSize); if (serviceName != null) { poolCfg.setPoolName(serviceName); } return poolCfg; }
GrizzlyUtils { public static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize) { checkArgument(poolSize >= 0, "Negative thread pool size"); final int threadPoolSize = poolSize > 0 ? Math.max(poolSize, MIN_SELECTORS) : getSelectorPoolSize(ioStrategy); final ThreadPoolConfig poolCfg = ThreadPoolConfig.defaultConfig(); poolCfg.setCorePoolSize(threadPoolSize).setMaxPoolSize(threadPoolSize); if (serviceName != null) { poolCfg.setPoolName(serviceName); } return poolCfg; } }
GrizzlyUtils { public static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize) { checkArgument(poolSize >= 0, "Negative thread pool size"); final int threadPoolSize = poolSize > 0 ? Math.max(poolSize, MIN_SELECTORS) : getSelectorPoolSize(ioStrategy); final ThreadPoolConfig poolCfg = ThreadPoolConfig.defaultConfig(); poolCfg.setCorePoolSize(threadPoolSize).setMaxPoolSize(threadPoolSize); if (serviceName != null) { poolCfg.setPoolName(serviceName); } return poolCfg; } private  GrizzlyUtils(); }
GrizzlyUtils { public static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize) { checkArgument(poolSize >= 0, "Negative thread pool size"); final int threadPoolSize = poolSize > 0 ? Math.max(poolSize, MIN_SELECTORS) : getSelectorPoolSize(ioStrategy); final ThreadPoolConfig poolCfg = ThreadPoolConfig.defaultConfig(); poolCfg.setCorePoolSize(threadPoolSize).setMaxPoolSize(threadPoolSize); if (serviceName != null) { poolCfg.setPoolName(serviceName); } return poolCfg; } private  GrizzlyUtils(); static Filter rpcMessageReceiverFor(Transport t); static Class< ? extends Transport> transportFor(int protocol); static int getDefaultWorkerPoolSize(); static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize); }
GrizzlyUtils { public static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize) { checkArgument(poolSize >= 0, "Negative thread pool size"); final int threadPoolSize = poolSize > 0 ? Math.max(poolSize, MIN_SELECTORS) : getSelectorPoolSize(ioStrategy); final ThreadPoolConfig poolCfg = ThreadPoolConfig.defaultConfig(); poolCfg.setCorePoolSize(threadPoolSize).setMaxPoolSize(threadPoolSize); if (serviceName != null) { poolCfg.setPoolName(serviceName); } return poolCfg; } private  GrizzlyUtils(); static Filter rpcMessageReceiverFor(Transport t); static Class< ? extends Transport> transportFor(int protocol); static int getDefaultWorkerPoolSize(); static ThreadPoolConfig getSelectorPoolCfg(IoStrategy ioStrategy, String serviceName, int poolSize);  }