@ManagedAttribute(id="thread-pool-type") public String getThreadPoolType() { return getType(transport.getWorkerThreadPool()); }
@Test public void testWorkerThreadPoolConfiguration2() throws Exception { LOGGER.log(Level.INFO, "Running: testWorkerThreadPoolConfiguration2 ({0})", transport.getName()); ThreadPoolConfig config = ThreadPoolConfig.defaultConfig(); config.setCorePoolSize(1); config.setMaxPoolSize(1); config.setPoolName("custom"); transport.setWorkerThreadPoolConfig(config); transport.setIOStrategy(SameThreadIOStrategy.getInstance()); assertNull(transport.getWorkerThreadPoolConfig()); assertNull(transport.getWorkerThreadPool()); }
@ManagedAttribute(id="thread-pool-type") public String getThreadPoolType() { return getType(transport.getWorkerThreadPool()); }
final ExecutorService executorService = transport.getWorkerThreadPool(); final GrizzlyExecutorService threadPool; if (executorService instanceof GrizzlyExecutorService) { threadPool = (GrizzlyExecutorService) transport.getWorkerThreadPool(); } else { threadPool = null;
final ExecutorService executorService = transport.getWorkerThreadPool(); final GrizzlyExecutorService threadPool; if (executorService instanceof GrizzlyExecutorService) { threadPool = (GrizzlyExecutorService) transport.getWorkerThreadPool(); } else { threadPool = null;
protected void configureHttp2Support(final ServiceLocator locator, final NetworkListener listener, final Http httpElement, final FilterChainBuilder builder, final boolean secure) { if (!skipHttp2 && httpElement != null && httpElement.isHttp2Enabled()) { Http2AddOn http2Addon = new Http2AddOn(Http2Configuration.builder() .disableCipherCheck(httpElement.isHttp2DisableCipherCheck()) .executorService(transport.getWorkerThreadPool()) .initialWindowSize(httpElement.getHttp2InitialWindowSizeInBytes()) .maxConcurrentStreams(httpElement.getHttp2MaxConcurrentStreams()) .maxFramePayloadSize(httpElement.getHttp2MaxFramePayloadSizeInBytes()) .maxHeaderListSize(httpElement.getHttp2MaxHeaderListSizeInBytes()) .build()); // The Http2AddOn requires access to more information compared to the other addons // that are currently leveraged. As such, we'll need to mock out a // Grizzly NetworkListener to pass to the AddOn. This mock object will // only provide the information necessary for the AddOn to operate. // It will be important to keep this mock in sync with the details the // AddOn requires. http2Addon.setup(createMockListener(secure), builder); isHttp2Enabled = true; } }