KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > util > pool > BoundedPool


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 //NOTE: Tabs are used instead of spaces for indentation.
25
// Make sure that your editor does not replace tabs with spaces.
26
// Set the tab length using your favourite editor to your
27
// visual preference.
28

29 /*
30  * Filename: BoundedPool.java
31  *
32  * Copyright 2000-2001 by iPlanet/Sun Microsystems, Inc.,
33  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
34  * All rights reserved.
35  *
36  * This software is the confidential and proprietary information
37  * of iPlanet/Sun Microsystems, Inc. ("Confidential Information").
38  * You shall not disclose such Confidential Information and shall
39  * use it only in accordance with the terms of the license
40  * agreement you entered into with iPlanet/Sun Microsystems.
41  */

42  
43 /**
44  * <BR> <I>$Source: /cvs/glassfish/appserv-commons/src/java/com/sun/enterprise/util/pool/BoundedPool.java,v $</I>
45  * @author $Author: tcfujii $
46  * @version $Revision: 1.3 $ $Date: 2005/12/25 04:12:26 $
47  */

48  
49 package com.sun.enterprise.util.pool;
50
51 import java.util.List JavaDoc;
52 import java.util.Iterator JavaDoc;
53 import java.util.ArrayList JavaDoc;
54 import java.util.Collection JavaDoc;
55
56 import java.lang.ref.Reference JavaDoc;
57 import java.lang.ref.SoftReference JavaDoc;
58
59 import com.sun.enterprise.util.collection.DList;
60 import com.sun.enterprise.util.collection.DListNode;
61
62 import com.sun.enterprise.util.scheduler.PeriodicallyServicable;
63 import com.sun.enterprise.util.scheduler.PeriodicEventScheduler;
64
65 import com.sun.enterprise.util.ApproximateClock;
66 import com.sun.enterprise.util.collection.DListNode;
67 import com.sun.enterprise.util.collection.DListNodeFactory;
68
69
70 public class BoundedPool
71     extends ObjectPool
72 {
73
74     /**
75      * Create an Unbounded pool.
76      * @param The ObjectFactory to create objects
77      * @param The minimum number of objects to be held in the pool (initial size)
78      * @param The pool limit (maximum number of objects in the pool).
79      * @param The maximum idle time after which the object may be removed from the pool.
80      */

81     public BoundedPool(ObjectFactory factory, int minSize, int maxLimit, long maxIdleTime) {
82         super(factory, minSize, minSize, maxLimit, maxIdleTime);
83     }
84     
85     /**
86      * Create an Unbounded pool.
87      * @param The ObjectFactory to create objects
88      * @param The minimum number of objects to be held in the pool (initial size)
89      * @param The pool limit (maximum number of objects in the pool).
90      * @param The maximum idle time after which the object may be removed from the pool.
91      * @param The initial size of the pool. If this is less than the minSize parameter then this is ignored.
92      * @param The maximum number of strong references that are to held. The difference between
93      * maxLimit and maxStrongRefs gives the number of objects held in the pool through SoftReferences.
94      */

95     public BoundedPool(ObjectFactory factory, int minSize, int maxLimit, long maxIdleTime,
96             int initialSize)
97     {
98         super(factory, minSize, initialSize, maxLimit, maxIdleTime);
99     }
100     
101     
102 }
Popular Tags