|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface EventManager
An interface for registering EventListeners to listen for
database events.
| 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()
|
java.lang.String |
getHost()
|
java.lang.String |
getPassword()
|
int |
getPort()
|
java.lang.String |
getUser()
|
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. |
| Method Detail |
|---|
void connect()
throws java.sql.SQLException
java.sql.SQLException - If a database communication error occurs
void disconnect()
throws java.sql.SQLException
java.sql.SQLException - If a database communication error occursvoid setUser(java.lang.String user)
user - for the connection to the database.java.lang.String getUser()
void setPassword(java.lang.String password)
password - for the connection to the database.java.lang.String getPassword()
void setDatabase(java.lang.String database)
database - path for the connection to the database.java.lang.String getDatabase()
java.lang.String getHost()
void setHost(java.lang.String host)
host - for the connection to the database.int getPort()
void setPort(int port)
port - for the connection to the database.
void addEventListener(java.lang.String eventName,
EventListener listener)
throws java.sql.SQLException
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 occurs
void removeEventListener(java.lang.String eventName,
EventListener listener)
throws java.sql.SQLException
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 occurs
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.
eventName - The name of the event to wait for
java.lang.InterruptedException - If interrupted while waiting
java.sql.SQLException - If a database access error occurs
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.
eventName - The name of the event to wait fortimeout - 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 | ||||||||