001/*
002 * Copyright 2012-2018 the original author or authors.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016
017package org.springframework.boot.autoconfigure.task;
018
019import org.springframework.boot.context.properties.ConfigurationProperties;
020
021/**
022 * Configuration properties for task scheduling.
023 *
024 * @author Stephane Nicoll
025 * @since 2.1.0
026 */
027@ConfigurationProperties("spring.task.scheduling")
028public class TaskSchedulingProperties {
029
030        private final Pool pool = new Pool();
031
032        /**
033         * Prefix to use for the names of newly created threads.
034         */
035        private String threadNamePrefix = "scheduling-";
036
037        public Pool getPool() {
038                return this.pool;
039        }
040
041        public String getThreadNamePrefix() {
042                return this.threadNamePrefix;
043        }
044
045        public void setThreadNamePrefix(String threadNamePrefix) {
046                this.threadNamePrefix = threadNamePrefix;
047        }
048
049        public static class Pool {
050
051                /**
052                 * Maximum allowed number of threads.
053                 */
054                private int size = 1;
055
056                public int getSize() {
057                        return this.size;
058                }
059
060                public void setSize(int size) {
061                        this.size = size;
062                }
063
064        }
065
066}