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