|
|||||||||
| 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(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()
|
java.lang.String |
getHost()
|
java.lang.String |
getPassword()
|
int |
getPort()
|
java.lang.String |
getUser()
|
long |
getWaitTimeout()
Get the time in milliseconds, after which the async threa will exit from the Object.wait(long) method and check whether it was stopped or
not. |
boolean |
isConnected()
|
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 . |
void |
setWaitTimeout(long waitTimeout)
Set the time in milliseconds, after which the async threa will exit from the Object.wait(long) method and check whether it was stopped or
not. |
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
EventManager
connect in interface EventManagerjava.sql.SQLException - If a database communication error occurs
public void disconnect()
throws java.sql.SQLException
EventManager
disconnect in interface EventManagerjava.sql.SQLException - If a database communication error occurspublic boolean isConnected()
public void setUser(java.lang.String user)
EventManager
setUser in interface EventManageruser - for the connection to the database.public java.lang.String getUser()
getUser in interface EventManagerpublic void setPassword(java.lang.String password)
EventManager
setPassword in interface EventManagerpassword - for the connection to the database.public java.lang.String getPassword()
getPassword in interface EventManagerpublic void setDatabase(java.lang.String database)
EventManager
setDatabase in interface EventManagerdatabase - path for the connection to the database.public java.lang.String getDatabase()
getDatabase in interface EventManagerpublic java.lang.String getHost()
getHost in interface EventManagerpublic void setHost(java.lang.String host)
EventManager
setHost in interface EventManagerhost - for the connection to the database.public int getPort()
getPort in interface EventManagerpublic void setPort(int port)
EventManager
setPort in interface EventManagerport - for the connection to the database.public long getWaitTimeout()
Object.wait(long) method and check whether it was stopped or
not.
Default value is 1000 (1 second);
public void setWaitTimeout(long waitTimeout)
Object.wait(long) method and check whether it was stopped or
not.
Default value is 1000 (1 second);
waitTimeout - wait timeout in milliseconds
public void addEventListener(java.lang.String eventName,
EventListener listener)
throws java.sql.SQLException
EventManager
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
java.sql.SQLException - If a database access error occurs
public void removeEventListener(java.lang.String eventName,
EventListener listener)
throws java.sql.SQLException
EventManager
removeEventListener in interface EventManagereventName - 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
public int waitForEvent(java.lang.String eventName)
throws java.lang.InterruptedException,
java.sql.SQLException
EventManagereventName 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
java.lang.InterruptedException - If interrupted while waiting
java.sql.SQLException - If a database access error occurs
public int waitForEvent(java.lang.String eventName,
int timeout)
throws java.lang.InterruptedException,
java.sql.SQLException
EventManagertimeout 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 EventManagereventName - 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 | ||||||||