Adds a pool configuration to the returned builder.

@param alias the pool alias
@param minSize the minimum number of threads in the pool
@param maxSize the maximum number of threads in the pool
@return a new builder with the added default pool
332022
public PooledExecutionServiceConfigurationBuilder pool(String alias, int minSize, int maxSize) {
    PooledExecutionServiceConfigurationBuilder other = new PooledExecutionServiceConfigurationBuilder(this);
    other.pools.add(new Pool(alias, minSize, maxSize));
    return other;
  }
772017
public static Client using(final Configuration configuration, final ClientConsumerType type, final int poolSize) throws Exception {
    return new Client(configuration, type, poolSize);
  }
383170
public static ThreadPoolExecutor newCachedThreadPool(int corePoolSize,
                                                         int maximumPoolSize,
                                                         BlockingQueue<Runnable> queue) {
        return new ThreadPoolExecutor(corePoolSize,
            maximumPoolSize,
            DateUtils.MILLISECONDS_PER_MINUTE,
            TimeUnit.MILLISECONDS,
            queue);
    }
413573
public static org.ironjacamar.core.connectionmanager.pool.Capacity create(
         org.ironjacamar.common.api.metadata.common.Capacity metadata,
         ClassLoaderPlugin classLoaderPlugin)
   {
      if (metadata == null)
         return DefaultCapacity.INSTANCE;

      CapacityIncrementer incrementer = null;
      CapacityDecrementer decrementer = null;

      // Incrementer
      if (metadata.getIncrementer() != null && metadata.getIncrementer().getClassName() != null)
      {
         incrementer = loadIncrementer(metadata.getIncrementer(), classLoaderPlugin);

         if (incrementer != null)
         {
            injectProperties(metadata.getIncrementer().getConfigPropertiesMap(), incrementer);
         }
         else
         {
            log.invalidCapacityIncrementer(metadata.getIncrementer().getClassName());
         }
      }

      if (incrementer == null)
         incrementer = DefaultCapacity.DEFAULT_INCREMENTER;

      // Decrementer
      if (metadata.getDecrementer() != null && metadata.getDecrementer().getClassName() != null)
      {

         decrementer = loadDecrementer(metadata.getDecrementer(), classLoaderPlugin);

         if (decrementer != null)
         {
            injectProperties(metadata.getDecrementer().getConfigPropertiesMap(), decrementer);

         }
         else
         {
            // Explicit allow TimedOutDecrementer, MinPoolSizeDecrementer and SizeDecrementer for CRI based pools
            if (TimedOutDecrementer.class.getName().equals(metadata.getDecrementer().getClassName()) ||
                TimedOutFIFODecrementer.class.getName().equals(metadata.getDecrementer().getClassName()) ||
                MinPoolSizeDecrementer.class.getName().equals(metadata.getDecrementer().getClassName()) ||
                SizeDecrementer.class.getName().equals(metadata.getDecrementer().getClassName()))
            {
               decrementer = loadDecrementer(metadata.getDecrementer(), classLoaderPlugin);

               injectProperties(metadata.getDecrementer().getConfigPropertiesMap(), decrementer);
            }
            else
            {
               log.invalidCapacityDecrementer(metadata.getDecrementer().getClassName());
            }
         }
      }

      if (decrementer == null)
         decrementer = DefaultCapacity.DEFAULT_DECREMENTER;

      return new ExplicitCapacity(incrementer, decrementer);
   }
1100141
private void createContextPool(Integer poolSize, String providerURL) throws NamingException {
        final String METHODNAME = "createContextPool";

        /*
         * Validate provider URL
         */
        if (providerURL == null) {
            providerURL = getPrimaryURL();
        }

        /*
         * Default the pool size if one was not provided.
         */
        if (poolSize == null) {
            poolSize = DEFAULT_INIT_POOL_SIZE;
        }

        /*
         * Enable the context pool
         */
        if (iContextPoolEnabled) {
            long currentTimeMillisec = System.currentTimeMillis();
            long currentTimeSeconds = roundToSeconds(currentTimeMillisec);

            // Don't purge the pool more than once per second
            // This prevents multiple threads from purging the pool
            if (currentTimeMillisec - iPoolCreateTimestampMillisec > 1000) {
                List<TimedDirContext> contexts = new Vector<TimedDirContext>(poolSize);
                Hashtable<String, Object> env = getEnvironment(URLTYPE_SEQUENCE, providerURL);

                String currentURL = null;
                try {
                    for (int i = 0; i < poolSize; i++) {
                        TimedDirContext ctx = createDirContext(env, currentTimeSeconds);
                        currentURL = getProviderURL(ctx);
                        if (!providerURL.equalsIgnoreCase(currentURL)) {
                            env = getEnvironment(URLTYPE_SEQUENCE, currentURL);
                            providerURL = currentURL;
                        }
                        contexts.add(ctx);
                        //iLiveContexts++;
                    }
                } catch (NamingException e) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, METHODNAME + " Context Pool creation FAILED for " + Thread.currentThread() + ", iLiveContext=" + iLiveContexts, e);
                    }
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, METHODNAME + " Cleanup contexts in temp pool: " + contexts.size());
                    }
                    for (int j = 0; j < contexts.size(); j++) {
                        try {
                            TimedDirContext ctx = contexts.get(j);
                            ctx.close();
                        } catch (Exception ee) {
                        }
                    }
                    throw e;
                }
                iLiveContexts += poolSize;

                // set active URL
                setActiveURL(providerURL);

                List<TimedDirContext> oldCtxs = iContexts;
                iContexts = contexts;
                iPoolCreateTimestampSeconds = currentTimeSeconds;
                iPoolCreateTimestampMillisec = currentTimeMillisec;
                closeContextPool(oldCtxs);

                if (tc.isDebugEnabled()) {
                    Tr.debug(tc, METHODNAME + " Active Provider URL: " + getActiveURL());
                    Tr.debug(tc, METHODNAME + " ContextPool: total=" + iLiveContexts + ", poolSize=" + iContexts.size(),
                             ", iPoolCreateTimestampSeconds=" + iPoolCreateTimestampSeconds);
                }
            } else if (tc.isDebugEnabled()) {
                Tr.debug(tc, METHODNAME + " Pool has already been purged within past second... skipping purge");
            }
        } else {
            setActiveURL(providerURL);
        }
    }
343559
private void adjustPoolSize() {
        if (lastCheck + 1000 < System.currentTimeMillis()) {
            int n = Runtime.getRuntime().availableProcessors();
            if (numProcessors != n) {
                executor.setMaximumPoolSize(n);
                numProcessors = n;
            }
            lastCheck = System.currentTimeMillis();
        }
    }
874594
public OrientGraphBaseFactory setupPool(final int max) {
    pool = new OPartitionedReCreatableDatabasePool(this.factory, dbName, user, password, max);
    return this;
  }
1311057
private void setEntityManagerPoolSize(String poolSize) {

        setExtProperty(
            CmsDbPoolV11.KEY_DATABASE_POOL + '.' + getPool() + '.' + CmsDbPoolV11.KEY_ENTITY_MANAGER_POOL_SIZE,
            poolSize);
    }
1362406
public static ThreadPoolExecutor newExecutor(int corePoolSize, int maximumPoolSize) {
		return ExecutorBuilder.create().setCorePoolSize(corePoolSize).setMaxPoolSize(maximumPoolSize).build();
	}
36526
public JComponent createButtonStack(final Size minimumButtonSize) {
		return createButtonStack(minimumButtonSize, GuiStandardUtils.createLeftAndRightBorder(UIConstants.TWO_SPACES));
	}
1016406
protected ExecutorService createDefaultExecutorService(ConcurrentAsyncExecutorProvider provider) {
        final int corePoolSize = 0;
        Integer maximumPoolSize = provider != null ? provider.provideMaxPoolSize() : null;
        if (maximumPoolSize == null) {
            maximumPoolSize = 10;
        }
        final long keepAliveTime = 60L;
        final TimeUnit seconds = TimeUnit.SECONDS;
        final BlockingQueue<Runnable> workQueue = createDefaultBlockingQueue();
        final RejectedExecutionHandler rejected = createRejectedExecutionHandler();
        return new ThreadPoolExecutor(corePoolSize, maximumPoolSize, keepAliveTime, seconds, workQueue, rejected);
    }
1152747
private PoolEntry createPoolEntry()
   {
      try {
         final PoolEntry poolEntry = newPoolEntry();

         final long maxLifetime = config.getMaxLifetime();
         if (maxLifetime > 0) {
            // variance up to 2.5% of the maxlifetime
            final long variance = maxLifetime > 10_000 ? ThreadLocalRandom.current().nextLong( maxLifetime / 40 ) : 0;
            final long lifetime = maxLifetime - variance;
            poolEntry.setFutureEol(houseKeepingExecutorService.schedule(
               () -> {
                  if (softEvictConnection(poolEntry, "(connection has passed maxLifetime)", false /* not owner */)) {
                     addBagItem(connectionBag.getWaitingThreadCount());
                  }
               },
               lifetime, MILLISECONDS));
         }

         return poolEntry;
      }
      catch (ConnectionSetupException e) {
         if (poolState == POOL_NORMAL) { // we check POOL_NORMAL to avoid a flood of messages if shutdown() is running concurrently
            logger.error("{} - Error thrown while acquiring connection from data source", poolName, e.getCause());
            lastConnectionFailure.set(e);
         }
         return null;
      }
      catch (SQLException e) {
         if (poolState == POOL_NORMAL) { // we check POOL_NORMAL to avoid a flood of messages if shutdown() is running concurrently
            logger.debug("{} - Cannot acquire connection from data source", poolName, e);
            lastConnectionFailure.set(new ConnectionSetupException(e));
         }
         return null;
      }
      catch (Exception e) {
         if (poolState == POOL_NORMAL) { // we check POOL_NORMAL to avoid a flood of messages if shutdown() is running concurrently
            logger.error("{} - Error thrown while acquiring connection from data source", poolName, e);
            lastConnectionFailure.set(new ConnectionSetupException(e));
         }
         return null;
      }
   }
378407
public static ResourcePoolsBuilder newResourcePoolsBuilder(ResourcePools pools) {
    ResourcePoolsBuilder poolsBuilder = new ResourcePoolsBuilder();
    for (ResourceType<?> currentResourceType : pools.getResourceTypeSet()) {
      poolsBuilder = poolsBuilder.with(pools.getPoolForResource(currentResourceType));
    }
    return poolsBuilder;
  }
700330
public static ThreadPoolExecutorFactoryBean newThreadPoolExecutorFactoryBean(final long keepAlive,
                                                                                 final long maxSize) {
        val bean = new ThreadPoolExecutorFactoryBean();
        bean.setMaxPoolSize((int) maxSize);
        bean.setKeepAliveSeconds((int) keepAlive);
        return bean;
    }
759177
public void initialise(String name, int minSize, int maxSize)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "initialise",
                                           new Object[]{name, minSize, maxSize});

      wasThreadPool = new com.ibm.ws.util.ThreadPool(name, minSize, maxSize);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "initialise");
   }
50300
public void addCacheConfiguration(final String alias, final CacheConfiguration<?, ?> config) {
    if (caches.put(alias, config) != null) {
      throw new IllegalStateException("Cache '" + alias + "' already present!");
    }
  }
752477
public ClientFactoryBuilder http2MaxFrameSize(int http2MaxFrameSize) {
        checkArgument(http2MaxFrameSize >= MAX_FRAME_SIZE_LOWER_BOUND &&
                      http2MaxFrameSize <= MAX_FRAME_SIZE_UPPER_BOUND,
                      "http2MaxFramSize: %s (expected: >= %s and <= %s)",
                      http2MaxFrameSize, MAX_FRAME_SIZE_LOWER_BOUND, MAX_FRAME_SIZE_UPPER_BOUND);
        this.http2MaxFrameSize = http2MaxFrameSize;
        return this;
    }