|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.firebirdsql.event.FBEventManager
An EventListener
implementation to listen for database events.
Constructor Summary | |
FBEventManager()
|
|
FBEventManager(org.firebirdsql.gds.impl.GDSType gdsType)
|
Method Summary | |
void |
addEventListener(java.lang.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. |
java.lang.String |
getDatabase()
Returns the database path for the connection to the database. |
java.lang.String |
getHost()
Returns the host for the connection to the database. |
java.lang.String |
getPassword()
Returns the password for the connection to the database. |
int |
getPort()
Returns the port for the connection to the database. |
java.lang.String |
getUser()
Returns the username for the connection to the databaes. |
boolean |
isConnected()
Check whether this object is connected to the database. |
void |
removeEventListener(java.lang.String eventName,
EventListener listener)
Remove an EventListener for a given event. |
void |
setDatabase(java.lang.String database)
Sets the database path for the connection to the database. |
void |
setHost(java.lang.String host)
Sets the host for the connection to the database. |
void |
setPassword(java.lang.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(java.lang.String user)
Sets the username for the connection to the database . |
int |
waitForEvent(java.lang.String eventName)
Wait for the one-time occurence of an event. |
int |
waitForEvent(java.lang.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(org.firebirdsql.gds.impl.GDSType gdsType)
Method Detail |
public void connect() throws java.sql.SQLException
connect
in interface EventManager
java.sql.SQLException
- If a database communication error occurspublic void disconnect() throws java.sql.SQLException
disconnect
in interface EventManager
java.sql.SQLException
- If a database communication error occurspublic boolean isConnected()
true
if object is connected to the
database, otherwise false
.public void setUser(java.lang.String user)
setUser
in interface EventManager
public java.lang.String getUser()
getUser
in interface EventManager
public void setPassword(java.lang.String password)
setPassword
in interface EventManager
password
- for the connection to the database.public java.lang.String getPassword()
getPassword
in interface EventManager
public void setDatabase(java.lang.String database)
setDatabase
in interface EventManager
database
- path for the connection to the database.public java.lang.String getDatabase()
getDatabase
in interface EventManager
public java.lang.String getHost()
getHost
in interface EventManager
public void setHost(java.lang.String host)
setHost
in interface EventManager
host
- for the connection to the database.public int getPort()
getPort
in interface EventManager
public void setPort(int port)
setPort
in interface EventManager
port
- for the connection to the database.public void addEventListener(java.lang.String eventName, EventListener listener) throws java.sql.SQLException
addEventListener
in interface EventManager
eventName
- The name of the event for which the listener will
be notifiedlistener
- The EventListener that will be called when the given
event occurs
java.sql.SQLException
- If a database access error occurspublic void removeEventListener(java.lang.String eventName, EventListener listener) throws java.sql.SQLException
removeEventListener
in interface EventManager
eventName
- The name of the event for which the listener
will be unregistered.listener
- The EventListener that is to be unregistered
java.sql.SQLException
- If a database access error occurspublic int waitForEvent(java.lang.String eventName) throws java.lang.InterruptedException, java.sql.SQLException
eventName
occurs. The return value is the
number of occurrences of the requested event.
waitForEvent
in interface EventManager
eventName
- The name of the event to wait for
java.lang.InterruptedException
- If interrupted while waiting
java.sql.SQLException
- If a database access error occurspublic int waitForEvent(java.lang.String eventName, int timeout) throws java.lang.InterruptedException, java.sql.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 EventManager
timeout
- The maximum number of milliseconds to wait
-1
if the call timed out
java.lang.InterruptedException
- If interrupted while waiting
java.sql.SQLException
- If a database access error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |