001    /*
002     * Copyright 2002-2005 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    
017    package org.jencks.factory;
018    
019    /**
020     * This abstract class defines common properties for every
021     * kind of pool used by the connection manager of Geronimo.
022     * <p/>
023     * These properties are the following:
024     * - maxSize: the max size of the pool
025     * - minSize: the min size of the pool
026     * - blockingTimeoutMilliseconds: the blocking timeout of the pool
027     * in milliseconds
028     * - idleTimeoutMinutes: the idle timeout of the pool in minutes
029     * - matchOne:
030     * - matchAll:
031     * selectOneAssumeMatch:
032     *
033     * @author Thierry Templier
034     * @see PartitionedPoolFactoryBean
035     * @see SinglePoolFactoryBean
036     */
037    public abstract class AbstractGeronimoPool {
038    
039        protected int maxSize;
040        protected int minSize;
041        protected int blockingTimeoutMilliseconds;
042        protected int idleTimeoutMinutes;
043        protected boolean matchOne;
044        protected boolean matchAll;
045        protected boolean selectOneAssumeMatch;
046    
047        public int getBlockingTimeoutMilliseconds() {
048            return blockingTimeoutMilliseconds;
049        }
050    
051        public int getIdleTimeoutMinutes() {
052            return idleTimeoutMinutes;
053        }
054    
055        public boolean isMatchAll() {
056            return matchAll;
057        }
058    
059        public boolean isMatchOne() {
060            return matchOne;
061        }
062    
063        public int getMaxSize() {
064            return maxSize;
065        }
066    
067        public int getMinSize() {
068            return minSize;
069        }
070    
071        public boolean isSelectOneAssumeMatch() {
072            return selectOneAssumeMatch;
073        }
074    
075        /**
076         * Set the blocking timeout property in milliseconds.
077         */
078        public void setBlockingTimeoutMilliseconds(int blockingTimeoutMilliseconds) {
079            this.blockingTimeoutMilliseconds = blockingTimeoutMilliseconds;
080        }
081    
082        /**
083         * Set the idle timeout property in minutes.
084         */
085        public void setIdleTimeoutMinutes(int idleTimeoutMinutes) {
086            this.idleTimeoutMinutes = idleTimeoutMinutes;
087        }
088    
089        /**
090         * Set the match all property.
091         */
092        public void setMatchAll(boolean matchAll) {
093            this.matchAll = matchAll;
094        }
095    
096        /**
097         * Set the match one property.
098         */
099        public void setMatchOne(boolean matchOne) {
100            this.matchOne = matchOne;
101        }
102    
103        /**
104         * Set the max size property of the pool.
105         */
106        public void setMaxSize(int maxSize) {
107            this.maxSize = maxSize;
108        }
109    
110        /**
111         * Set the min size property of the pool.
112         */
113        public void setMinSize(int minSize) {
114            this.minSize = minSize;
115        }
116    
117        /**
118         * Set the select one assume mathc property.
119         */
120        public void setSelectOneAssumeMatch(boolean selectOneAssumeMatch) {
121            this.selectOneAssumeMatch = selectOneAssumeMatch;
122            }
123    
124    }