09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Getting the Exception Listener<br />

Usage Notes<br />

If a serious problem is detected for the connection, the connection's<br />

ExceptionListener, if one has been registered, will be informed. This is done by<br />

calling the listener's onException() method, passing it a JMSException<br />

describing the problem. This allows a JMS client to be asynchronously notified of a<br />

problem. Some connections only consume messages, so they have no other way to<br />

learn the connection has failed.<br />

Syntax<br />

See Chapter 3, "AQ Programmatic Environments" for a list of available functions in<br />

each programmatic environment. Use the following syntax references for each<br />

programmatic environment:<br />

See Java (JDBC): <strong>Oracle</strong>9i Supplied Java Packages Reference oracle.jms<br />

AQjmsConnection.setExceptionListener<br />

Examples<br />

//register an exception listener<br />

Connection jms_connection;<br />

jms_connection.setExceptionListener(<br />

new ExceptionListener() {<br />

public void onException (JMSException jmsException) {<br />

System.out.println("JMS-EXCEPTION: " + jmsException.toString());<br />

}<br />

};<br />

);<br />

Getting the Exception Listener<br />

Figure 16–58 Getting the Exception Listener<br />

User/<br />

Program<br />

JMS Operational Interface - Connection :<br />

GETTING an Exception Listener<br />

GET<br />

ExceptionListener<br />

at Connection<br />

getExceptionListener<br />

JMS Operational Interface: Basic Operations (Shared Interfaces) 16-91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!