01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.com
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.pool.connection;
09:
10: import java.sql.Connection;
11:
12: import org.huihoo.jfox.pool.ObjectPool;
13: import org.huihoo.jfox.pool.PoolableObject;
14:
15: /**
16: *
17: * @author <a href="mailto:kelvin_wym@hotmail.com">Kelvin Wu</a>
18: */
19:
20: public interface PoolableConnection extends PoolableObject {
21: /**
22: * Get the pool that this poolableConnection belongs to,
23: * so the poolableConnection can be managed by the pool.
24: */
25: ObjectPool getPool();
26:
27: /**
28: * Set which pool that this PoolableConnection belongs to.
29: * @param pool
30: */
31: void setPool(ObjectPool pool);
32:
33: /**
34: * Close the physical connection that this PoolableConnection wrapped.
35: */
36: void reallyClose();
37:
38: void setUsing(boolean b);
39:
40: boolean isUsing();
41:
42: /**
43: * get the physical connection
44: * @return
45: */
46: Connection getConnection();
47:
48: // override java.sql.Connection.close() method
49: void close();
50: }
|