Tabnine Logo
TCPNIOTransportBuilder.setSelectorThreadPoolConfig
Code IndexAdd Tabnine to your IDE (free)

How to use
setSelectorThreadPoolConfig
method
in
org.glassfish.grizzly.nio.transport.TCPNIOTransportBuilder

Best Java code snippets using org.glassfish.grizzly.nio.transport.TCPNIOTransportBuilder.setSelectorThreadPoolConfig (Showing top 7 results out of 315)

origin: org.glassfish.tyrus/tyrus-container-grizzly

  transportBuilder.getSelectorThreadPoolConfig().setMaxPoolSize(1).setCorePoolSize(1);
} else {
  transportBuilder.setSelectorThreadPoolConfig(selectorThreadPoolConfig);
origin: org.forgerock.ce.opendj/opendj-ldap-sdk

      useWorkerThreadStrategy ? Math.max(2, cpus / 4) : Math.max(5, (cpus / 2) - 1);
builder.setSelectorThreadPoolConfig(ThreadPoolConfig.defaultConfig().setCorePoolSize(
    selectorThreadCount).setMaxPoolSize(selectorThreadCount).setPoolName(
    "OpenDJ LDAP SDK Grizzly selector thread"));
origin: org.glassfish.tyrus/tyrus-container-grizzly-client

if (sharedTransport) {
  transportBuilder.setSelectorThreadPoolConfig(ThreadPoolConfig.defaultConfig());
} else {
  transportBuilder.setSelectorThreadPoolConfig(
      ThreadPoolConfig.defaultConfig().setMaxPoolSize(1).setCorePoolSize(1));
  TCPNIOTransport transport = transportBuilder.build();
transportBuilder.setSelectorThreadPoolConfig(selectorThreadPoolConfig);
origin: eclipse-ee4j/tyrus

if (sharedTransport) {
  transportBuilder.setSelectorThreadPoolConfig(ThreadPoolConfig.defaultConfig());
} else {
  transportBuilder.setSelectorThreadPoolConfig(
      ThreadPoolConfig.defaultConfig().setMaxPoolSize(1).setCorePoolSize(1));
  TCPNIOTransport transport = transportBuilder.build();
transportBuilder.setSelectorThreadPoolConfig(selectorThreadPoolConfig);
origin: javaee/grizzly

@Test
public void testCustomThreadPoolSameThreadStrategy() throws Exception {
  final int poolSize = Math.max(Runtime.getRuntime().availableProcessors()/2, 1);
  final ThreadPoolConfig poolCfg = ThreadPoolConfig.defaultConfig();
  poolCfg.setCorePoolSize(poolSize).setMaxPoolSize(poolSize);
  final TCPNIOTransport tcpTransport = TCPNIOTransportBuilder.newInstance()
      .setReuseAddress(true)
      .setIOStrategy(SameThreadIOStrategy.getInstance())
      .setSelectorThreadPoolConfig(poolCfg)
      .setWorkerThreadPoolConfig(null)
      .build();
  try {
    tcpTransport.start();
  } finally {
    tcpTransport.shutdownNow();
  }
}
origin: eclipse-ee4j/tyrus

transportBuilder.setSelectorThreadPoolConfig(selectorThreadPoolConfig);
origin: javaee/grizzly

  @Test
  public void testCustomThreadPoolWorkerThreadStrategy() throws Exception {

    final int selectorPoolSize =  Math.max(Runtime.getRuntime().availableProcessors()/2, 1);
    final ThreadPoolConfig selectorPoolCfg = ThreadPoolConfig.defaultConfig();
    selectorPoolCfg.setCorePoolSize(selectorPoolSize).setMaxPoolSize(selectorPoolSize);

    final int workerPoolSize = Runtime.getRuntime().availableProcessors() * 2 ;
    final ThreadPoolConfig workerPoolCfg = ThreadPoolConfig.defaultConfig();
    workerPoolCfg.setCorePoolSize(workerPoolSize).setMaxPoolSize(workerPoolSize);

    final TCPNIOTransport tcpTransport = TCPNIOTransportBuilder.newInstance()
        .setReuseAddress(true)
        .setIOStrategy(WorkerThreadIOStrategy.getInstance())
        .setSelectorThreadPoolConfig(selectorPoolCfg)
        .setWorkerThreadPoolConfig(workerPoolCfg)
        .build();
    try {
      tcpTransport.start();
    } finally {
      tcpTransport.shutdownNow();
    }
  }    
}
org.glassfish.grizzly.nio.transportTCPNIOTransportBuildersetSelectorThreadPoolConfig

Popular methods of TCPNIOTransportBuilder

  • newInstance
  • build
  • <init>
  • getThis
  • setIOStrategy
  • setReuseAddress
  • getWorkerThreadPoolConfig
  • setTcpNoDelay
  • setKeepAlive
  • setWorkerThreadPoolConfig
  • setConnectionTimeout
  • setProcessor
  • setConnectionTimeout,
  • setProcessor,
  • setLinger,
  • setOptimizedForMultiplexing,
  • setClientSocketSoTimeout,
  • setReadBufferSize,
  • setServerConnectionBackLog,
  • setServerSocketSoTimeout,
  • setWriteBufferSize

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now