KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > snaq > db > ConnectionPoolEvent


1 /*
2     DBPool - JDBC Connection Pool Manager
3     Copyright (c) Giles Winstanley
4 */

5 package snaq.db;
6
7 import snaq.util.ObjectPool;
8 import snaq.util.ObjectPoolEvent;
9
10 /**
11  * Event for ConnectionPool objects.
12  * @author Giles Winstanley
13  */

14 public class ConnectionPoolEvent extends ObjectPoolEvent
15 {
16     public static final int VALIDATION_ERROR = 9;
17
18
19     protected ConnectionPoolEvent(ObjectPool pool, int type)
20     {
21         super(pool, type);
22     }
23
24     public ConnectionPool getConnectionPool() { return (ConnectionPool)getSource(); }
25
26 /* public String getTypeString()
27     {
28         switch(getType())
29         {
30             case VALIDATION_ERROR: return "VALIDATION_ERROR";
31         }
32         return super.getTypeString();
33     }*/

34
35     public boolean isValidationError() { return getType() == VALIDATION_ERROR; }
36 }
Popular Tags