ExtendedThreadPool.getMaximumPoolSize
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.sun.grizzly.util.ExtendedThreadPool.getMaximumPoolSize(Showing top 6 results out of 315)

origin: com.sun.grizzly/grizzly-utils

@SuppressWarnings("deprecation")
protected ThreadPoolConfig updateFrom(ExtendedThreadPool ep) {
  this.queue = ep.getQueue();
  this.threadFactory = ep.getThreadFactory();
  this.poolName = ep.getName();
  this.maxPoolSize = ep.getMaximumPoolSize();
  //hiding internal values, due to they might not match configure
  //this.queueLimit = ep.getMaxQueuedTasksCount();
  //this.corepoolsize = ep.getCorePoolSize();
  //this.keepAliveTime = keepAliveTime;
  //this.timeUnit = timeUnit;
  //this.monitoringProbe = monitoringProbe;
  return this;
}
origin: com.sun.grizzly/grizzly-comet

/**
 * sets the default ThreadPool that DefaultNotificationHandler use.
 * shutdownNow is called on the existing ThreadPool.
 * does not update existing notification handlers.
 */
public final void setThreadPool(ExtendedThreadPool pool) {
  if (pool != null) {
    if (threadPool != null) {
      threadPool.shutdownNow();
    }
    threadPool = pool;
    SelectorFactory.setMaxSelectors(pool.getMaximumPoolSize());
  }
}
origin: com.sun.grizzly/grizzly-http

maxPoolSize = ((ExtendedThreadPool) threadPool).getMaximumPoolSize();
origin: com.sun.grizzly/grizzly-framework

private void ensureAppropriatePoolSize( ExecutorService threadPool ) {
  if( threadPool == null )
    return;
  if( threadPool instanceof GrizzlyExecutorService ) {
    final GrizzlyExecutorService grizzlyExecutorService =
        (GrizzlyExecutorService) threadPool;
    final ThreadPoolConfig config = grizzlyExecutorService.getConfiguration();
    
    if( config.getCorePoolSize() < requiredThreadsCount ) {
      if( config.getMaxPoolSize() < requiredThreadsCount )
        config.setMaxPoolSize( requiredThreadsCount );
      config.setCorePoolSize( requiredThreadsCount );
      grizzlyExecutorService.reconfigure(config);
    }
  } else if( threadPool instanceof ExtendedThreadPool ) {
    final ExtendedThreadPool extendedThreadPool = (ExtendedThreadPool)threadPool;
    if( extendedThreadPool.getCorePoolSize() < requiredThreadsCount ) {
      if( extendedThreadPool.getMaximumPoolSize() < requiredThreadsCount )
        extendedThreadPool.setMaximumPoolSize( requiredThreadsCount );
      extendedThreadPool.setCorePoolSize( requiredThreadsCount );
    }
  } else if( threadPool instanceof ThreadPoolExecutor ) {
    final ThreadPoolExecutor jdkThreadPool = (ThreadPoolExecutor)threadPool;
    if( jdkThreadPool.getCorePoolSize() < requiredThreadsCount ) {
      if( jdkThreadPool.getMaximumPoolSize() < requiredThreadsCount )
        jdkThreadPool.setMaximumPoolSize( requiredThreadsCount );
      jdkThreadPool.setCorePoolSize( requiredThreadsCount );
    }
  }
}
origin: com.sun.grizzly/grizzly-rcm

if (p instanceof ExtendedThreadPool) {
  ExtendedThreadPool threadPool = (ExtendedThreadPool) p;
  int maxThreads = threadPool.getMaximumPoolSize();
origin: com.sun.grizzly/grizzly-http

float threadRatio =
  (float) st.getActiveCount()
  / (float) st.getMaximumPoolSize();
com.sun.grizzly.utilExtendedThreadPoolgetMaximumPoolSize

Javadoc

Returns the maximum allowed number of threads.

Popular methods of ExtendedThreadPool

  • getQueueSize
    Returns the number of tasks, which are currently waiting in the queue.
  • setCorePoolSize
    Sets the core number of threads. This overrides any value set in the constructor. If the new value i
  • getActiveCount
    Returns the approximate number of threads that are actively executing tasks.
  • getThreadFactory
    Returns the thread factory used to create new threads.
  • setMaximumPoolSize
    Sets the maximum allowed number of threads. This overrides any value set in the constructor. If the
  • shutdownNow
  • awaitTermination
  • execute
  • getCompletedTaskCount
    Returns the approximate total number of tasks that have completed execution. Because the states of t
  • getCorePoolSize
    Returns the core number of threads.
  • getLargestPoolSize
    Returns the largest number of threads that have ever simultaneously been in the pool.
  • getMaxQueuedTasksCount
  • getLargestPoolSize,
  • getMaxQueuedTasksCount,
  • getName,
  • getPoolSize,
  • getQueue,
  • getTaskCount,
  • isShutdown,
  • isTerminated,
  • setName

Popular classes and methods

  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • Menu (java.awt)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Thread (java.lang)
    A Thread is a concurrent unit of execution. It has its own call stack for methods being invoked, the
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Runner (org.openjdk.jmh.runner)
    Runner executes JMH benchmarks.This is the entry point for JMH Java API. Runner is not usually reu

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)