/** * Get the instance context manager for XNIO workers by delegating to {@link #getContextManager()}. * * @return the context manager (not {@code null}) */ public ContextManager<XnioWorker> getInstanceContextManager() { return getContextManager(); }
static Endpoint parseEndpoint() throws ConfigXMLParseException, IOException { final ClientConfiguration clientConfiguration = ClientConfiguration.getInstance(); final EndpointBuilder builder = new EndpointBuilder(); builder.setXnioWorker(XnioWorker.getContextManager().get()); if (clientConfiguration != null) try (final ConfigurationXMLStreamReader streamReader = clientConfiguration.readConfiguration(Collections.singleton(NS_REMOTING_5_0))) { parseDocument(streamReader, builder); return builder.build(); } else { return null; } }
final XnioWorker.Builder workerBuilder = endpointBuilder.getWorkerBuilder(); if (workerBuilder == null) { xnioWorker = XnioWorker.getContextManager().get(); endpoint = new EndpointImpl(xnioWorker, false, endpointName, connectionOptions); } else {
WildflyHttpContext build() { XnioWorker worker = XnioWorker.getContextManager().get(); ByteBufferPool pool; if(bufferConfig == null) { pool=new DefaultByteBufferPool(true, 1024, 100, 0, LEAK_DETECTION); //TODO } else { pool = new DefaultByteBufferPool(bufferConfig.isDirect(), bufferConfig.getBufferSize(), bufferConfig.getMaxSize(), bufferConfig.getThreadLocalSize(), LEAK_DETECTION); } //TODO: ssl config ConfigSection[] connections = new ConfigSection[this.targets.size()]; long idleTimout = this.idleTimeout > 0 ? this.idleTimeout : 60000; int maxConnections = this.maxConnections > 0 ? this.maxConnections : 10; int maxStreamsPerConnection = this.maxStreamsPerConnection > 0 ? this.maxStreamsPerConnection : 10; for (int i = 0; i < this.targets.size(); ++i) { HttpConfigBuilder sb = this.targets.get(i); HostPool hp = new HostPool(sb.getUri()); boolean eager = this.eagerlyAcquireSession == null ? false : this.eagerlyAcquireSession; if (sb.getEagerlyAcquireSession() != null && sb.getEagerlyAcquireSession()) { eager = true; } boolean http2 = this.enableHttp2 == null ? true : this.enableHttp2; if(sb.getEnableHttp2() != null) { http2 = sb.getEnableHttp2(); } ConfigSection connection = new ConfigSection(new HttpTargetContext(new HttpConnectionPool(sb.getMaxConnections() > 0 ? sb.getMaxConnections() : maxConnections, sb.getMaxStreamsPerConnection() > 0 ? sb.getMaxStreamsPerConnection() : maxStreamsPerConnection, worker, pool, OptionMap.create(UndertowOptions.ENABLE_HTTP2, http2), hp, sb.getIdleTimeout() > 0 ? sb.getIdleTimeout() : idleTimout), eager, sb.getUri()), sb.getUri()); connections[i] = connection; } return new WildflyHttpContext(connections, maxConnections, maxStreamsPerConnection, idleTimeout, eagerlyAcquireSession == null ? false : eagerlyAcquireSession, worker, pool, enableHttp2 == null ? true : enableHttp2); }
/** * Get the instance context manager for XNIO workers by delegating to {@link #getContextManager()}. * * @return the context manager (not {@code null}) */ public ContextManager<XnioWorker> getInstanceContextManager() { return getContextManager(); }
static Endpoint parseEndpoint() throws ConfigXMLParseException, IOException { final ClientConfiguration clientConfiguration = ClientConfiguration.getInstance(); final EndpointBuilder builder = new EndpointBuilder(); builder.setXnioWorker(XnioWorker.getContextManager().get()); if (clientConfiguration != null) try (final ConfigurationXMLStreamReader streamReader = clientConfiguration.readConfiguration(Collections.singleton(NS_REMOTING_5_0))) { parseDocument(streamReader, builder); return builder.build(); } else { return null; } }
final XnioWorker.Builder workerBuilder = endpointBuilder.getWorkerBuilder(); if (workerBuilder == null) { xnioWorker = XnioWorker.getContextManager().get(); endpoint = new EndpointImpl(xnioWorker, false, endpointName, connectionOptions); } else {
WildflyHttpContext build() { XnioWorker worker = XnioWorker.getContextManager().get(); ByteBufferPool pool; if(bufferConfig == null) { pool=new DefaultByteBufferPool(true, 1024, 100, 0, LEAK_DETECTION); //TODO } else { pool = new DefaultByteBufferPool(bufferConfig.isDirect(), bufferConfig.getBufferSize(), bufferConfig.getMaxSize(), bufferConfig.getThreadLocalSize(), LEAK_DETECTION); } //TODO: ssl config ConfigSection[] connections = new ConfigSection[this.targets.size()]; long idleTimout = this.idleTimeout > 0 ? this.idleTimeout : 60000; int maxConnections = this.maxConnections > 0 ? this.maxConnections : 10; int maxStreamsPerConnection = this.maxStreamsPerConnection > 0 ? this.maxStreamsPerConnection : 10; for (int i = 0; i < this.targets.size(); ++i) { HttpConfigBuilder sb = this.targets.get(i); HostPool hp = new HostPool(sb.getUri()); boolean eager = this.eagerlyAcquireSession == null ? false : this.eagerlyAcquireSession; if (sb.getEagerlyAcquireSession() != null && sb.getEagerlyAcquireSession()) { eager = true; } boolean http2 = this.enableHttp2 == null ? true : this.enableHttp2; if(sb.getEnableHttp2() != null) { http2 = sb.getEnableHttp2(); } ConfigSection connection = new ConfigSection(new HttpTargetContext(new HttpConnectionPool(sb.getMaxConnections() > 0 ? sb.getMaxConnections() : maxConnections, sb.getMaxStreamsPerConnection() > 0 ? sb.getMaxStreamsPerConnection() : maxStreamsPerConnection, worker, pool, OptionMap.create(UndertowOptions.ENABLE_HTTP2, http2), hp, sb.getIdleTimeout() > 0 ? sb.getIdleTimeout() : idleTimout), eager, sb.getUri()), sb.getUri()); connections[i] = connection; } return new WildflyHttpContext(connections, maxConnections, maxStreamsPerConnection, idleTimeout, eagerlyAcquireSession == null ? false : eagerlyAcquireSession, worker, pool, enableHttp2 == null ? true : enableHttp2); }
WildflyHttpContext build() { XnioWorker worker = XnioWorker.getContextManager().get(); ByteBufferPool pool; if(bufferConfig == null) { pool=new DefaultByteBufferPool(true, 1024, 100, 0, LEAK_DETECTION); //TODO } else { pool = new DefaultByteBufferPool(bufferConfig.isDirect(), bufferConfig.getBufferSize(), bufferConfig.getMaxSize(), bufferConfig.getThreadLocalSize(), LEAK_DETECTION); } //TODO: ssl config ConfigSection[] connections = new ConfigSection[this.targets.size()]; long idleTimout = this.idleTimeout > 0 ? this.idleTimeout : 60000; int maxConnections = this.maxConnections > 0 ? this.maxConnections : 10; int maxStreamsPerConnection = this.maxStreamsPerConnection > 0 ? this.maxStreamsPerConnection : 10; for (int i = 0; i < this.targets.size(); ++i) { HttpConfigBuilder sb = this.targets.get(i); HostPool hp = new HostPool(sb.getUri()); boolean eager = this.eagerlyAcquireSession == null ? false : this.eagerlyAcquireSession; if (sb.getEagerlyAcquireSession() != null && sb.getEagerlyAcquireSession()) { eager = true; } boolean http2 = this.enableHttp2 == null ? true : this.enableHttp2; if(sb.getEnableHttp2() != null) { http2 = sb.getEnableHttp2(); } ConfigSection connection = new ConfigSection(new HttpTargetContext(new HttpConnectionPool(sb.getMaxConnections() > 0 ? sb.getMaxConnections() : maxConnections, sb.getMaxStreamsPerConnection() > 0 ? sb.getMaxStreamsPerConnection() : maxStreamsPerConnection, worker, pool, OptionMap.create(UndertowOptions.ENABLE_HTTP2, http2), hp, sb.getIdleTimeout() > 0 ? sb.getIdleTimeout() : idleTimout), eager, sb.getUri()), sb.getUri()); connections[i] = connection; } return new WildflyHttpContext(connections, maxConnections, maxStreamsPerConnection, idleTimeout, eagerlyAcquireSession == null ? false : eagerlyAcquireSession, worker, pool, enableHttp2 == null ? true : enableHttp2); }