public interface DatabaseChangeRegistration extends NotificationRegistration
oracle.jdbc.OracleStatement.setDatabaseChangeRegistration(oracle.jdbc.dcn.DatabaseChangeRegistration)NotificationRegistration.RegistrationState| Modifier and Type | Method and Description |
|---|---|
void |
addFailureListener(FailureListener failureListener)
Registers a
FailureListener that the JDBC driver invokes when its
automatic failover attempts for this registration cannot be completed
successfully. |
void |
addListener(DatabaseChangeListener listener)
Register a listener with this registration.
|
void |
addListener(DatabaseChangeListener listener,
java.util.concurrent.Executor e)
Register a listener with this registration.
|
long |
getRegId()
Returns the registration id provided by the database.
|
int |
getRegistrationId()
Deprecated.
This method is deprecated in 11.2. Use
getRegId() instead. |
java.lang.String[] |
getTables()
Returns the name of the tables associated with this registration.
|
void |
removeFailureListener()
Unregisters the failure listener previously added through
addFailureListener(FailureListener). |
void |
removeListener(DatabaseChangeListener listener)
Remove a listener from the list of registered listeners.
|
getDatabaseName, getRegistrationException, getRegistrationOptions, getState, getUserNameint getRegistrationId()
getRegId() instead.long getRegId()
java.lang.String[] getTables()
void addFailureListener(FailureListener failureListener)
FailureListener that the JDBC driver invokes when its
automatic failover attempts for this registration cannot be completed
successfully. Use this hook to log the failure, trigger compensating
actions, or schedule application-level retries once the driver stops
retrying.failureListener - listener to invoke after failover retries are
exhausted; must not be nulljava.lang.NullPointerException - if failureListener is nullvoid addListener(DatabaseChangeListener listener) throws java.sql.SQLException
Note that the listener's code will be executed in the thread owned by the driver.
java.sql.SQLExceptionvoid addListener(DatabaseChangeListener listener, java.util.concurrent.Executor e) throws java.sql.SQLException
This method lets you control which thread will execute the listener's code when an event occurs by specifying an executor. You can provide your own executor which can for example use a pool of threads.
java.sql.SQLExceptionvoid removeListener(DatabaseChangeListener listener) throws java.sql.SQLException
java.sql.SQLExceptionvoid removeFailureListener()
addFailureListener(FailureListener).
If no failure listener is registered when this method is invoked, the call has no effect.