KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > util > pool > PoolHelper


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.util.pool;
16
17 import org.apache.commons.pool.*;
18
19 /**
20  * Pool Helper class.
21  * @since 1.4.7
22  */

23 public class PoolHelper {
24     
25     /**
26      * Check if Pool is open.
27      */

28     public static boolean isPoolOpen(ObjectPool pool) {
29         try {
30             pool.getNumIdle();
31         } catch(Exception JavaDoc e) {
32             return false;
33         }
34         return true;
35     }
36 }
37
Popular Tags