01: /*
02: * ConnectionEvent.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.event;
23:
24: import java.util.EventObject;
25: import org.executequery.databasemediators.*;
26:
27: /* ----------------------------------------------------------
28: * CVS NOTE: Changes to the CVS repository prior to the
29: * release of version 3.0.0beta1 has meant a
30: * resetting of CVS revision numbers.
31: * ----------------------------------------------------------
32: */
33:
34: /**
35: * Defines a connection connect/disconnect event.
36: *
37: * @author Takis Diakoumis
38: * @version $Revision: 1.4 $
39: * @date $Date: 2006/05/14 06:56:52 $
40: */
41: public class ConnectionEvent extends EventObject {
42:
43: private DatabaseConnection databaseConnection;
44:
45: /** Creates a new instance of ConnectionEvent */
46: public ConnectionEvent(DatabaseConnection databaseConnection) {
47: super (databaseConnection);
48: this .databaseConnection = databaseConnection;
49: }
50:
51: public boolean isConnected() {
52: if (databaseConnection != null) {
53: return databaseConnection.isConnected();
54: }
55: return false;
56: }
57:
58: public DatabaseConnection getSource() {
59: return databaseConnection;
60: }
61:
62: }
|