|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.event.FBEventManager
public class FBEventManager
An EventListener implementation to listen for database events.
| Constructor Summary | |
|---|---|
FBEventManager()
|
|
FBEventManager(GDSType gdsType)
|
|
| Method Summary | |
|---|---|
void |
addEventListener(String eventName,
EventListener listener)
Register an EventListener that will be called when an event occurs. |
void |
connect()
Make a connection with a database to listen for events. |
void |
disconnect()
Close the connection to the database. |
String |
getDatabase()
Returns the database path for the connection to the database. |
String |
getHost()
Returns the host for the connection to the database. |
String |
getPassword()
Returns the password for the connection to the database. |
int |
getPort()
Returns the port for the connection to the database. |
String |
getUser()
Returns the username for the connection to the databaes. |
boolean |
isConnected()
Check whether this object is connected to the database. |
void |
removeEventListener(String eventName,
EventListener listener)
Remove an EventListener for a given event. |
void |
setDatabase(String database)
Sets the database path for the connection to the database. |
void |
setHost(String host)
Sets the host for the connection to the database. |
void |
setPassword(String password)
Sets the password for the connection to the database. |
void |
setPort(int port)
Sets the port for the connection to the database. |
void |
setUser(String user)
Sets the username for the connection to the database . |
int |
waitForEvent(String eventName)
Wait for the one-time occurence of an event. |
int |
waitForEvent(String eventName,
int timeout)
Wait for the one-time occurence of an event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FBEventManager()
public FBEventManager(GDSType gdsType)
| Method Detail |
|---|
public void connect()
throws SQLException
connect in interface EventManagerSQLException - If a database communication error occurs
public void disconnect()
throws SQLException
disconnect in interface EventManagerSQLException - If a database communication error occurspublic boolean isConnected()
true if object is connected to the
database, otherwise false.public void setUser(String user)
setUser in interface EventManagerusername - for the connection to the database.public String getUser()
getUser in interface EventManagerpublic void setPassword(String password)
setPassword in interface EventManagerpassword - for the connection to the database.public String getPassword()
getPassword in interface EventManagerpublic void setDatabase(String database)
setDatabase in interface EventManagerdatabase - path for the connection to the database.public String getDatabase()
getDatabase in interface EventManagerpublic String getHost()
getHost in interface EventManagerpublic void setHost(String host)
setHost in interface EventManagerhost - for the connection to the database.public int getPort()
getPort in interface EventManagerpublic void setPort(int port)
setPort in interface EventManagerport - for the connection to the database.
public void addEventListener(String eventName,
EventListener listener)
throws SQLException
addEventListener in interface EventManagereventName - The name of the event for which the listener will
be notifiedlistener - The EventListener that will be called when the given
event occurs
SQLException - If a database access error occurs
public void removeEventListener(String eventName,
EventListener listener)
throws SQLException
removeEventListener in interface EventManagereventName - The name of the event for which the listener
will be unregistered.listener - The EventListener that is to be unregistered
SQLException - If a database access error occurs
public int waitForEvent(String eventName)
throws InterruptedException,
SQLException
eventName occurs. The return value is the
number of occurrences of the requested event.
waitForEvent in interface EventManagereventName - The name of the event to wait for
InterruptedException - If interrupted while waiting
SQLException - If a database access error occurs
public int waitForEvent(String eventName,
int timeout)
throws InterruptedException,
SQLException
timeout milliseconds,
waiting for the event identified by eventName to occur.
A timeout value of 0 means wait indefinitely.
The return value is the number of occurences of the event in question,
or -1 if the call timed out.
waitForEvent in interface EventManagerexenvtName - The name of the event to wait fortimeout - The maximum number of milliseconds to wait
-1 if the call timed out
InterruptedException - If interrupted while waiting
SQLException - If a database access error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||