KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > perseus > pool > api > PoolAttributes


1 /**
2  * Copyright (C) 2001-2002
3  * - France Telecom R&D
4  * - Laboratoire Logiciels, Systemes, Reseaux - UMR 5526, CNRS-INPG-UJF
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Release: 1.0
21  *
22  * Authors:
23  *
24  */

25
26 package org.objectweb.perseus.pool.api;
27
28 import org.objectweb.fractal.api.control.AttributeController;
29
30 /**
31  * This interafece contains the accessor methods (getters and setters) which
32  * permit to tune a Pool:
33  * <ul>
34  * <li>
35  * A <b>Timeout</b> can be assigned to a Pool. It is used when no more
36  * PoolResource is available and when the Pool has reached its maximum size.
37  * This is the timeout to wait for a free PoolResource until exting with an
38  * exception. It defaults to 0, which means waiting forever until a
39  * PoolResource is freed. Its value should be greater or equal to 0 ; negative
40  * values are ignored (setTimeOut(-1) => NOP).
41  * </li>
42  * <li>
43  * A <b>MinSize</b> can be assigned to a Pool. Its value should be greater or
44  * equal to 0, and smaller or equal to MaxSize. Values that do not match these
45  * conditions are ignored (e.g., setMinSize(-1) => NOP).
46  * This size means that there is always MinSize PoolResource allocated in this
47  * Pool. If PoolResource needs to be allocated when setting this size,
48  * "getPoolMatchFactory().createResource(null)" is called. Its default value
49  * is 0.
50  * </li>
51  * <li>
52  * A <b>MaxSize</b> can be assigned to a Pool. Its value should be greater or
53  * equal to 0, and greater or equal to MinSize. Values that do not match these
54  * conditions are ignored (e.g., setMaxSize(-1) => NOP). Its default value
55  * is 0, thus it is mandatory to set this value for making the Poll functional.
56  * </li>
57  * </ul>
58  *
59  * @author S.Chassande-Barrioz
60  */

61 public interface PoolAttributes extends AttributeController {
62
63
64     /**
65      * <b>getTimeout</b> retrieves the timeout assigned to this Pool.
66      * @return The timeout currently assigned to this Pool.
67      */

68     long getTimeout();
69
70     /**
71      * <b>getMinSize</b> retrieves the minimum size assigned to this Pool.
72      * @return The minimum size currently assigned to this Pool.
73      */

74     int getMinSize();
75
76     /**
77      * <b>getMaxSize</b> retrieves the maximum size assigned to this Pool.
78      * @return The maximum size currently assigned to this Pool.
79      */

80     int getMaxSize();
81
82     /**
83      * <b>getTTL</b> retrieves the time to live of pool
84      * resources (in milisecond).
85      */

86     long getTTL();
87
88     /**
89      * <b>getTTL</b> retrieves the time to live of pool
90      * resources when they are unused (in milisecond).
91      */

92     long getInactiveTTL();
93
94     /**
95      * <b>setTimeout</b> assigns a timeout to this Pool.
96      * @param crto The timeout to be assigned.
97      */

98     void setTimeout(long crto);
99
100     /**
101      * <b>setMinSize</b> assigns a minimum size to this Pool.
102      * @param minsize The minimum size to be assigned.
103      */

104     void setMinSize(int minsize) throws Exception JavaDoc;
105
106     /**
107      * <b>setMaxSize</b> assigns a maximum size to this Pool.
108      * @param maxsize The maximum size to be assigned.
109      */

110     void setMaxSize(int maxsize) throws Exception JavaDoc;
111
112     /**
113      * <b>setTTL</b> assignes the time (in milisecond) to live of pool
114      * resources. If the value is lesser or equal to 0 then pool resources do
115      * not have a TTL.
116      */

117     void setTTL(long ttl);
118
119     /**
120      * <b>setTTL</b> assignes the time (in milisecond) to live of pool
121      * resources when they are unused. If the value is lesser or equal to 0
122      * then pool resources do not have a TTL.
123      */

124     void setInactiveTTL(long ttl);
125
126 }
127
Popular Tags