congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
QueuedThreadPool.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.eclipse.jetty.util.thread.QueuedThreadPool
constructor

Best Java code snippets using org.eclipse.jetty.util.thread.QueuedThreadPool.<init> (Showing top 20 results out of 1,116)

origin: perwendel/spark

/**
 * Creates a Jetty server.
 *
 * @param maxThreads          maxThreads
 * @param minThreads          minThreads
 * @param threadTimeoutMillis threadTimeoutMillis
 * @return a new jetty server instance
 */
public Server create(int maxThreads, int minThreads, int threadTimeoutMillis) {
  Server server;
  if (maxThreads > 0) {
    int max = maxThreads;
    int min = (minThreads > 0) ? minThreads : 8;
    int idleTimeout = (threadTimeoutMillis > 0) ? threadTimeoutMillis : 60000;
    server = new Server(new QueuedThreadPool(max, min, idleTimeout));
  } else {
    server = new Server();
  }
  return server;
}
origin: stackoverflow.com

 QueuedThreadPool threadPool = new QueuedThreadPool(100, 10);
Server server = new Server(threadPool);
origin: jphp-group/jphp

@Signature
public void __construct() {
  threadPool = new QueuedThreadPool();
  server = new Server(threadPool);
  initSessionManager();
}
origin: apache/hbase

private HttpServer(final Builder b) throws IOException {
 this.appDir = b.appDir;
 this.logDir = b.logDir;
 final String appDir = getWebAppsPath(b.name);
 int maxThreads = b.conf.getInt(HTTP_MAX_THREADS, 16);
 // If HTTP_MAX_THREADS is less than or equal to 0, QueueThreadPool() will use the
 // default value (currently 200).
 QueuedThreadPool threadPool = maxThreads <= 0 ? new QueuedThreadPool()
   : new QueuedThreadPool(maxThreads);
 threadPool.setDaemon(true);
 this.webServer = new Server(threadPool);
 this.adminsAcl = b.adminsAcl;
 this.webAppContext = createWebAppContext(b.name, b.conf, adminsAcl, appDir);
 this.findPort = b.findPort;
 initializeWebServer(b.name, b.hostName, b.conf, b.pathSpecs);
}
origin: Alluxio/alluxio

mServiceName = serviceName;
QueuedThreadPool threadPool = new QueuedThreadPool();
int webThreadCount = ServerConfiguration.getInt(PropertyKey.WEB_THREADS);
origin: spring-projects/spring-framework

@Override
public void afterPropertiesSet() throws Exception {
  String name = this.threadPrefix + "@" + Integer.toHexString(hashCode());
  if (this.executor == null) {
    QueuedThreadPool threadPool = new QueuedThreadPool();
    threadPool.setName(name);
    this.executor = threadPool;
  }
  if (this.byteBufferPool == null) {
    this.byteBufferPool = new MappedByteBufferPool(2048,
        this.executor instanceof ThreadPool.SizedThreadPool
            ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2
            : ProcessorUtils.availableProcessors() * 2);
  }
  if (this.scheduler == null) {
    this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false);
  }
  if (this.executor instanceof LifeCycle) {
    ((LifeCycle)this.executor).start();
  }
  this.scheduler.start();
}
origin: jphp-group/jphp

@Signature
public void __construct(int port, String host) {
  threadPool = new QueuedThreadPool();
  server = new Server(threadPool);
  if (host == null || host.isEmpty()) {
    listen(LongMemory.valueOf(port));
  } else {
    listen(StringMemory.valueOf(host + ":" + port));
  }
  initSessionManager();
}
origin: org.springframework/spring-web

@Override
public void afterPropertiesSet() throws Exception {
  String name = this.threadPrefix + "@" + Integer.toHexString(hashCode());
  if (this.executor == null) {
    QueuedThreadPool threadPool = new QueuedThreadPool();
    threadPool.setName(name);
    this.executor = threadPool;
  }
  if (this.byteBufferPool == null) {
    this.byteBufferPool = new MappedByteBufferPool(2048,
        this.executor instanceof ThreadPool.SizedThreadPool
            ? ((ThreadPool.SizedThreadPool) executor).getMaxThreads() / 2
            : ProcessorUtils.availableProcessors() * 2);
  }
  if (this.scheduler == null) {
    this.scheduler = new ScheduledExecutorScheduler(name + "-scheduler", false);
  }
  if (this.executor instanceof LifeCycle) {
    ((LifeCycle)this.executor).start();
  }
  this.scheduler.start();
}
origin: jooby-project/jooby

  conf.getBytes("server.http.MaxRequestSize").toString());
QueuedThreadPool pool = conf(new QueuedThreadPool(), conf.getConfig("jetty.threads"),
  "jetty.threads");
origin: neo4j/neo4j

private static QueuedThreadPool createQueuedThreadPool( JettyThreadCalculator jtc )
{
  BlockingQueue<Runnable> queue = new BlockingArrayQueue<>( jtc.getMinThreads(), jtc.getMinThreads(), jtc.getMaxCapacity() );
  QueuedThreadPool threadPool = new QueuedThreadPool( jtc.getMaxThreads(), jtc.getMinThreads(), JETTY_THREAD_POOL_IDLE_TIMEOUT, queue );
  threadPool.setThreadPoolBudget( null ); // mute warnings about Jetty thread pool size
  return threadPool;
}
origin: apache/ignite

httpSrv = new Server(new QueuedThreadPool(200, 20));
origin: apache/flume

    + " before I started one."
    + "Will not attempt to start.");
QueuedThreadPool threadPool = new QueuedThreadPool();
if (sourceContext.getSubProperties("QueuedThreadPool.").size() > 0) {
 FlumeBeanConfigurator.setConfigurationFields(threadPool, sourceContext);
origin: apache/incubator-dubbo

QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setDaemon(true);
threadPool.setMaxThreads(threads);
origin: apache/incubator-dubbo

QueuedThreadPool threadPool = new QueuedThreadPool();
threadPool.setDaemon(true);
threadPool.setMaxThreads(threads);
origin: apache/incubator-druid

httpClient.setConnectTimeout(CLIENT_CONNECT_TIMEOUT_MILLIS);
httpClient.setRequestBufferSize(config.getRequestBuffersize());
final QueuedThreadPool pool = new QueuedThreadPool(config.getNumMaxThreads());
pool.setName(JettyHttpClientModule.class.getSimpleName() + "-threadPool-" + pool.hashCode());
httpClient.setExecutor(pool);
origin: gocd/gocd

@Before
public void setUp() throws Exception {
  initMocks(this);
  when(server.getThreadPool()).thenReturn(new QueuedThreadPool(1));
  Answer<Void> setHandlerMock = invocation -> {
    serverLevelHandler = (Handler) invocation.getArguments()[0];
origin: apache/hive

private void createWebServer(final Builder b) throws IOException {
 // Create the thread pool for the web server to handle HTTP requests
 QueuedThreadPool threadPool = new QueuedThreadPool();
 if (b.maxThreads > 0) {
  threadPool.setMaxThreads(b.maxThreads);
 }
 threadPool.setDaemon(true);
 threadPool.setName(b.name + "-web");
 this.webServer = new Server(threadPool);
 this.appDir = getWebAppsPath(b.name);
 this.webAppContext = createWebAppContext(b);
 if (b.useSPNEGO) {
  // Secure the web server with kerberos
  setupSpnegoFilter(b);
 }
 if (b.enableCORS) {
  setupCORSFilter(b);
 }
 initializeWebServer(b, threadPool.getMaxThreads());
}
origin: jersey/jersey

if (threadPoolSize != null && threadPoolSize instanceof Integer && (Integer) threadPoolSize > 0) {
  final String name = HttpClient.class.getSimpleName() + "@" + hashCode();
  final QueuedThreadPool threadPool = new QueuedThreadPool((Integer) threadPoolSize);
  threadPool.setName(name);
  client.setExecutor(threadPool);
origin: igniterealtime/Openfire

final QueuedThreadPool tp = new QueuedThreadPool(processingThreads);
tp.setName("Jetty-QTP-BOSH");
origin: apache/nifi

public JettyServer(final NiFiProperties props, final Set<Bundle> bundles) {
  final QueuedThreadPool threadPool = new QueuedThreadPool(props.getWebThreads());
  threadPool.setName("NiFi Web Server");
org.eclipse.jetty.util.threadQueuedThreadPool<init>

Javadoc

Construct

Popular methods of QueuedThreadPool

  • setMaxThreads
    Set the maximum number of threads. Delegated to the named or anonymous Pool.
  • setMinThreads
    Set the minimum number of threads. Delegated to the named or anonymous Pool.
  • setName
  • getMaxThreads
    Set the maximum number of threads. Delegated to the named or anonymous Pool.
  • setDaemon
    Delegated to the named or anonymous Pool.
  • getMinThreads
    Get the minimum number of threads. Delegated to the named or anonymous Pool.
  • getThreads
  • setIdleTimeout
    Set the maximum thread idle time. Threads that are idle for longer than this period may be stopped.
  • getIdleThreads
  • runJob
    Runs the given job in the Thread#currentThread(). Subclasses may override to perform pre/post actio
  • isRunning
  • isStarted
  • isRunning,
  • isStarted,
  • isStopping,
  • newThread,
  • setStopTimeout,
  • dispatch,
  • start,
  • getThreadsPriority,
  • getQueue

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • Reference (javax.naming)
  • JTextField (javax.swing)
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Runner (org.openjdk.jmh.runner)
  • Top plugins for Android Studio
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