001/*
002 * Copyright 2011 Atteo.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
005 * in compliance with the License. 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 distributed under the License
010 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
011 * or implied. See the License for the specific language governing permissions and limitations under
012 * the License.
013 */
014package org.atteo.moonshine.jta;
015
016import javax.xml.bind.annotation.XmlElement;
017import javax.xml.bind.annotation.XmlRootElement;
018
019import org.atteo.evo.config.Configurable;
020
021@XmlRootElement(name = "pool")
022public class PoolOptions extends Configurable {
023
024    /**
025     * Sets the minimum pool size.
026     * The amount of pooled connections won't go below that value.
027     * The pool will open this amount of connections during initialization.
028     */
029    @XmlElement
030    private Integer minPoolSize;
031
032    /**
033     * Sets the maximum pool size. The amount of pooled connections won't go
034     * above this value. Optional, defaults to 1.
035     */
036    @XmlElement
037    private Integer maxPoolSize;
038
039    /**
040     * Sets the maximum amount of seconds that unused excess connections should stay in the pool. Optional.
041     *
042     * Note: excess connections are connections that are created above the minPoolSize limit.
043     * Note that this value is only an indication; the pool will check regularly as indicated
044     * by the maintenanceInteval property.
045     */
046    @XmlElement
047    private Integer maxIdleTime;
048
049    /**
050     * Sets the amount of time (in seconds) that the connection pool will allow a connection
051     * to be in use, before claiming it back. Optional.
052     *
053     * The timeout in seconds. Zero means unlimited. Note that this value is
054     * only an indication; the pool will check regularly as indicated by the maintenanceInteval property.
055     */
056    @XmlElement
057    private Integer reapTimeout;
058
059    public Integer getMinPoolSize() {
060        return minPoolSize;
061    }
062
063    public Integer getMaxPoolSize() {
064        return maxPoolSize;
065    }
066
067    public Integer getMaxIdleTime() {
068        return maxIdleTime;
069    }
070
071    public Integer getReapTimeout() {
072        return reapTimeout;
073    }
074}