KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > smartlib > pool > core > MultiPool


1 package org.smartlib.pool.core;
2
3 import java.sql.Connection JavaDoc;
4
5 /**
6  * Created by IntelliJ IDEA.
7  * User: kerneldebugger
8  * Date: Oct 1, 2005
9  * Time: 6:44:17 PM
10  * To change this template use File | Settings | File Templates.
11  */

12 public interface MultiPool {
13
14     /**
15      * This method returns a Connection from the connection pool.
16      * The owner of this pool is marked as N/A indicating unknown.
17      *
18      * <b>Note: This method blocks if the pool size has reached it's
19      * maximum size and no free connections are available
20      * until a free connection is available</b>. The time period for which this
21      * method blocks depends on the connection-wait-time-out specified in
22      * the configuration file.
23      *
24      *
25       * @return Connection from the pool
26      * @exception ConnectionPoolException if there is any problem
27      * getting connection.
28      */

29     public Connection JavaDoc getConnection()
30         throws ConnectionPoolException;
31
32
33     /**
34      * This method returns a Connection from the pool.
35      * The owner of this connection is identified by <code>owner</code> .
36      *
37      * <b>Note: This method blocks if the pool size has reached it's
38      * maximum size and no free connections are available
39      * until a free connection is available</b>. The time period for which this
40      * method blocks depends on the connection-wait-time-out specified in
41      * the configuration file.
42      *
43      *
44      * @param owner String identifying the owner.
45       * @return Connection from the pool
46      *
47      * @exception ConnectionPoolException if there is any problem
48      * getting connection.
49      */

50
51     public Connection JavaDoc getConnection(String JavaDoc owner)
52         throws ConnectionPoolException;
53
54
55     /**
56      * This method adds a connection leak listener. The methods of
57      * <code>cle</code> will be called when a leak is detected as per the
58      * pool configuration.
59      *
60      * @param cle Class implementing ConnectionLeakListener interface.
61      * @exception ConnectionPoolException If there is any problem
62      * adding ConnectionLeakListener.
63      */

64     public void addConnectionLeakListener(ConnectionLeakListener cle )
65         throws ConnectionPoolException;
66
67     /**
68      * This method removes a connection leak listener.<code>cle</code> will
69      * not get any further notifications.
70      *
71      * @param cle Class implementing ConnectionLeakListener interface.
72      * @exception ConnectionPoolException If there is any problem
73      * removing ConnectionLeakListener.
74      */

75     public void removeConnectionLeakListener(ConnectionLeakListener cle)
76         throws ConnectionPoolException;
77
78     /**
79      * This method shuts down the pool
80      */

81     public void shutDown();
82
83 }
84
Popular Tags