|
Oracle® Database JDBC Java API Reference 11g Release 2 ("11.2.0.0.1-Beta-1") BETA E13995-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface AQNotificationRegistration
This class represents your interest in being notified when a new message is enqueued in a particular queue. This feature is called AQ asynchronous notification.
You retrieve an instance or multiple instances of this class by calling the method registerAQNotification on the connection.
Code example:
Properties globalOptions = new Properties();
// Here we register our interest into one single-consumer
// queue called "SCOTT.MY_RAW_QUEUE" which needs to be properly
// created and started:
String[] queueNameArr = new String[1];
queueNameArr[0] = "SCOTT.MY_RAW_QUEUE";
Properties[] opt = new Properties[1];
opt[0] = new Properties();
// we want to retrieve the payload within the notification:
opt[0].setProperty(OracleConnection.NTF_AQ_PAYLOAD,"true");
// 'conn' is a valid instance of OracleConnection:
AQNotificationRegistration[] regArr
= conn.registerAQNotification(queueNameArr,opt,globalOptions);
AQNotificationRegistration reg = regArr[0];
// listener is an instance of AQNotificationListener:
reg.addListener(listener);
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface oracle.jdbc.NotificationRegistration |
|---|
NotificationRegistration.RegistrationState |
| Method Summary | |
|---|---|
void |
addListener(AQNotificationListener listener) |
void |
addListener(AQNotificationListener listener, java.util.concurrent.Executor e) |
java.lang.String |
getQueueName()Returns the name of the queue for which we have register our interest in being notified. |
void |
removeListener(AQNotificationListener listener) |
| Methods inherited from interface oracle.jdbc.NotificationRegistration |
|---|
getDatabaseName, getRegistrationOptions, getState, getUserName |
| Method Detail |
|---|
void addListener(AQNotificationListener listener)
throws java.sql.SQLException
java.sql.SQLException
void addListener(AQNotificationListener listener,
java.util.concurrent.Executor e)
throws java.sql.SQLException
java.sql.SQLException
void removeListener(AQNotificationListener listener)
throws java.sql.SQLException
java.sql.SQLExceptionjava.lang.String getQueueName()
|
Oracle® Database JDBC Java API Reference 11g Release 2 ("11.2.0.0.1-Beta-1") BETA E13995-01 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||