public class ConnectionEvent extends EventObject
ConnectionListener
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CONNECT
it was a connect try
|
static int |
DISCONNECT
it was a disconnect
|
Constructor and Description |
---|
ConnectionEvent(Object source,
int type,
DbUtils utils)
constructs the event
|
ConnectionEvent(Object source,
int type,
DbUtils utils,
Exception ex)
constructs the event
|
Modifier and Type | Method and Description |
---|---|
boolean |
failed()
whether an exception happened and is stored
|
DbUtils |
getDbUtils()
returns the DbUtils instance that is responsible for the
connect/disconnect.
|
Exception |
getException()
returns the stored exception, if any (can be NULL)
|
int |
getType()
returns the type of this event, CONNECT or DISCONNECT
|
boolean |
isConnected()
returns whether the connection is still open.
|
String |
toString()
returns the event in a string representation
|
getSource
public static final int CONNECT
public static final int DISCONNECT
public ConnectionEvent(Object source, int type, DbUtils utils)
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the
connectionpublic ConnectionEvent(Object source, int type, DbUtils utils, Exception ex)
source
- the source that generated this eventtype
- whether CONNECT or DISCONNECT happenedutils
- the DatabaseUtils isntance responsible for the
connectionex
- a possible exception, if not successfulpublic int getType()
CONNECT
,
DISCONNECT
public boolean failed()
public boolean isConnected()
public Exception getException()
public DbUtils getDbUtils()
public String toString()
toString
in class EventObject
Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.