Create a new queued pool using the defaults for key of type K, request of
type R, and value of Type V.

@param factory The factory that creates objects
@return The created pool
965009
public static <K, V> QueuedKeyedResourcePool<K, V> create(ResourceFactory<K, V> factory) {
        return create(factory, new ResourcePoolConfig());
    }
445473
public Mailbox createMailbox(MailboxesQueue queue) {
        if (mailboxCreator != null) {
            return mailboxCreator.createMailbox(queue);
        } else {
            return new Mailbox(queue);
        }
    }
42121
public <P extends ProcessBuilder> QueueBuilder<P> newQueueBuilder(Class<P> process_builder_class)
    {
        return QueueFactory.newQueueBuilder(this, process_builder_class);
    }
1184513
protected PoolWaitFuture<E> createFuture(final PoolKey<K> key) {
		return new PoolWaitFuture<E>(lock) {
			protected E getPoolObject(long timeout, TimeUnit unit) throws IOException, InterruptedException, TimeoutException {
				return getBlockingUntilAvailableOrTimeout(key, timeout, unit, this);
			}
		};
	}
616456
@SuppressWarnings(value = "unchecked")
  <T, K extends SharedResourceKey> SharedResourceFactoryResponse<T> getScopedFromCache(
      final SharedResourceFactory<T, K, S> factory, @Nonnull final K key,
      @Nonnull final ScopeWrapper<S> scope, final SharedResourcesBrokerImpl<S> broker)
      throws ExecutionException {
    RawJobBrokerKey fullKey = new RawJobBrokerKey(scope, factory.getName(), key);
    Object obj = this.sharedResourceCache.get(fullKey, new Callable<Object>() {
      @Override
      public Object call() throws Exception {
        return factory.createResource(broker.getScopedView(scope.getType()), broker.getConfigView(scope.getType(), key,
            factory.getName()));
      }
    });

    return (SharedResourceFactoryResponse<T>)obj;
  }
555705
public JdbcQueueFactory<T, ID, DATA> setDefaultJdbcHelper(IJdbcHelper jdbcHelper) {
        return setDefaultJdbcHelper(jdbcHelper, false);
    }
652885
private PooledConnection createPooledConnection(JDBCConnection connection)
    throws SQLException {

        LifeTimeConnectionWrapper connectionWrapper =
            new LifeTimeConnectionWrapper(connection, this.connectionDefaults);
        JDBCPooledConnection pooledConnection =
            new JDBCPooledConnection(connectionWrapper);

        connectionWrapper.setPooledConnection(pooledConnection);

        return pooledConnection;
    }
5659
public static <K, T> IKeyedObjectPool.Single<K, T> createPool(IPoolObjectFactory<K, T> factory) {
	return new KeyedSingleObjectPool<K, T>(factory);
  }
963515
public synchronized DatabaseContextFactory dbFactory( String databaseUri )
	{
		DatabaseContextFactory factory = new DatabaseContextFactory();
		if( ! factory.init( databaseUri ) )
		{
			log.error( "Cannot initialize database connection pool, it won't be available to the program !" );
			return null;
		}
		
		return factory;
	}
494243
public Object create(Object locator) throws CreateException {
		if (locator == null)
			throw new NullPointerException("Locator cannot be null");

		// Iterate from the latest factories
		for (int index = _factories.size() - 1; index >= 0; index--) {
			IFactory factory = _factories.get(index);
			if (factory.canCreate(locator) != null)
				return factory.create(locator);
		}

		throw new CreateException(null, locator);
	}
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);
    }
737905
ThreadPoolExecutor createChannelExecutor(String channel, final String threadPrefix, final int workerCount, int queueSize) {
		ThreadFactory threadFactory = new ThreadFactory() {
			private int counter = 0;
			@Override
			public Thread newThread(Runnable runnable) {
				return new Thread(runnable, threadPrefix + "-" + ++counter);
			}
		};
		ThreadPoolExecutor executor = new ChannelThreadPoolExecutor(channel, workerCount,
				new LinkedBlockingQueue<Runnable>(queueSize), threadFactory);
		return executor;
	}
659733
@CheckReturnValue
  public static Builder fromPool(Pool pool) {
    return new BuilderImpl(pool.poolShutdown, () -> {
      try {
        return pool.dataSource.getConnection();
      } catch (Exception e) {
        throw new DatabaseException("Unable to obtain a connection from the DataSource", e);
      }
    }, new OptionsDefault(pool.flavor));
  }
185823
public ObjectPool<MemcachedClientIF> getObjectPool() {
        val pool = new GenericObjectPool<MemcachedClientIF>(this);
        pool.setMaxIdle(memcachedProperties.getMaxIdle());
        pool.setMinIdle(memcachedProperties.getMinIdle());
        pool.setMaxTotal(memcachedProperties.getMaxTotal());
        return pool;
    }
1230940
@Override
  public MtasTokenizer create(AttributeFactory factory) {
    MtasTokenizer tokenizer = null;
    try {
      tokenizer = create(factory, null);
    } catch (IOException e) {
      log.error(e);
    }
    return tokenizer;
  }
236086
public static SqlSessionFactory getSessionFactory() throws IOException {
		SqlSessionFactory sessionFactory = THREAD_SESSION_FACTORY.get();
		try {
			if (sessionFactory == null) {
				sessionFactory = new DefaultSqlSessionFactory();
				THREAD_SESSION_FACTORY.set(sessionFactory);
			}
		} catch (Exception e) {  
	        throw new IOException(e);  
	    }  
	    return sessionFactory;  
	}
529760
public static <T> QueueJsonDeserializer<T> newInstance( JsonDeserializer<T> deserializer ) {
        return new QueueJsonDeserializer<T>( deserializer );
    }