    001// Licensed under the Apache License, Version 2.0 (the "License");
    002// you may not use this file except in compliance with the License.
    003// You may obtain a copy of the License at
    004//
    005// http://www.apache.org/licenses/LICENSE-2.0
    006//
    007// Unless required by applicable law or agreed to in writing, software
    008// distributed under the License is distributed on an "AS IS" BASIS,
    009// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    010// See the License for the specific language governing permissions and
    011// limitations under the License.
    012
    013package org.apache.tapestry5.ioc;
    014
    015/**
    016 * Configuration symbols used by the IoC container.
    017 *
    018 * @since 5.2.2
    019 */
    020public class IOCSymbols
    021{
    022    /**
    023     * The minimum size of the thread pool. The default is 3. When a task is created and there are fewer
    024     * than this number of threads in the pool, a new thread is created for the task.
    025     */
    026    public static final String THREAD_POOL_CORE_SIZE = "tapestry.thread-pool.core-pool-size";
    027
    028    /**
    029     * The size of the task queue. When there are at least {@linkplain #THREAD_POOL_CORE_SIZE the core number} of
    030     * threads in the pool, tasks will be placed in the queue. If the queue is empty, more threads
    031     * may be created (up to the {@linkplain #THREAD_POOL_MAX_SIZE maximum pool size}). If the queue is full and
    032     * all threads have been created, the task is rejected.
    033     *
    034     * The default is 100.
    035     *
    036     * @since 5.3
    037     * @see <a href="http://www.bigsoft.co.uk/blog/index.php/2009/11/27/rules-of-a-threadpoolexecutor-pool-size">
    038     *     Rules of a ThreadPoolExecutor pool size
    039     *     </a>
    040     */
    041    public static final String THREAD_POOL_QUEUE_SIZE = "tapestry.thread-pool.queue-size";
    042
    043    /**
    044     * Maximium size of the thread pool, which defaults to 10.
    045     */
    046    public static final String THREAD_POOL_MAX_SIZE = "tapestry.thread-pool.max-pool-size";
    047
    048    /**
    049     * Time in milliseconds (via {@link org.apache.tapestry5.ioc.util.TimeInterval}) to keep waiting threads alive.
    050     * Default is one minute.
    051     */
    052    public static final String THREAD_POOL_KEEP_ALIVE = "tapestry.thread-pool.keep-alive";
    053
    054    /**
    055     * By default, the {@link org.apache.tapestry5.ioc.services.ParallelExecutor} service uses a thread pool. In
    056     * environments (such as Google Application Engine) where thread creation is not allowed, this can be set to
    057     * "false", and deferred logic will, instead, execute immediately.
    058     *
    059     * @since 5.1.0.3
    060     */
    061    public static final String THREAD_POOL_ENABLED = "tapestry.thread-pool-enabled";
    062}