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.

}<br />

db_drv.getCacheSize(10);<br />

this.setAQDataSource(db_drv);<br />

/* Set the transaction timeout to 180 seconds */<br />

this.setSessionMaxInactiveTime(180);<br />

}<br />

catch (Exception ex)<br />

{<br />

System.out.println("Exception in init: " + ex);<br />

}<br />

Setting the Style Sheet for All Responses from the Servlet<br />

Customizing the AQ Servlet<br />

The AQ servlet sends back responses in XML. The servlet administrator can specify<br />

a style sheet that is to be set for all responses sent back from this servlet. This can be<br />

done by invoking the setStyleSheet(type,href)or the<br />

setStyleSheetProcessingInstr(proc_instr) in init() method of the<br />

servlet.<br />

For example, to include the following style sheet instruction for all responses, do<br />

the following:<br />

<br />

The servlet is initialized as follows:<br />

public class AQTestServlet extends oracle.AQ.xml.AQxmlServlet<br />

{<br />

/* The init method must be overloaded to specify the AQxmlDataSource */<br />

public void init()<br />

{<br />

AQxmlDataSource db_drv = null;<br />

try<br />

{<br />

/* Create data source with username, password, sid, host, port */<br />

db_drv = new AQxmlDataSource("AQADM", "AQADM",<br />

"test_db", "sun-248", "5521");<br />

this.setAQDataSource(db_drv);<br />

/* Set the bookOrder.xsl style sheet for all responses */<br />

Internet Access to <strong>Advanced</strong> <strong>Queuing</strong> 17-67

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

Saved successfully!

Ooh no, something went wrong!