<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 09 20:48:46 GMT 2011 --> <TITLE> PooledXQConnection </TITLE> <META NAME="date" CONTENT="2011-12-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PooledXQConnection"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/xml/xquery/ConnectionPoolXQDataSource.html" title="interface in javax.xml.xquery"><B>PREV CLASS</B></A> <A HREF="../../../javax/xml/xquery/XQCancelledException.html" title="class in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/xquery/PooledXQConnection.html" target="_top"><B>FRAMES</B></A> <A HREF="PooledXQConnection.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> javax.xml.xquery</FONT> <BR> Interface PooledXQConnection</H2> <HR> <DL> <DT><PRE>public interface <B>PooledXQConnection</B></DL> </PRE> <P> An object that provides hooks for connection pool management. A <code>PooledXQConnection</code> object represents a physical connection to a data source. The connection can be recycled rather than being closed when an application is finished with it, thus reducing the number of connections that need to be made. <P> An application programmer does not use the <code>PooledXQConnection</code> interface directly; rather, it is used by a middle tier infrastructure that manages the pooling of connections. <P> When an application calls the method <code>XQDataSource.getConnection</code>, it gets back an <code>XQConnection</code> object. If connection pooling is being done, that <code>XQConnection</code> object is actually a handle to a <code>PooledXQConnection</code> object, which is a physical connection. <P> The connection pool manager, typically the application server, maintains a pool of <code>PooledXQConnection</code> objects. If there is a <code>PooledXQConnection</code> object available in the pool, the connection pool manager returns an <code>XQConnection</code> object that is a handle to that physical connection. If no <code>PooledXQConnection</code> object is available, the connection pool manager calls the <code>ConnectionPoolXQDataSource</code> method <code>getPooledConnection</code> to create a new physical connection and returns a handle to it. <P> When an application closes a connection, it calls the <code>XQConnection</code> method <code>close</code>. When connection pooling is being done, the connection pool manager is notified because it has registered itself as an <code>XQConnectionEventListener</code> object using the <code>PooledXQConnection</code> method <code>addConnectionEventListener</code>. The connection pool manager deactivates the handle to the <code>PooledXQConnection</code> object and returns the <code>PooledXQConnection</code> object to the pool of connections so that it can be used again. Thus, when an application closes its connection, the underlying physical connection is recycled rather than being closed. <P> The physical connection is not closed until the connection pool manager calls the <code>PooledXQConnection</code> method <code>close</code>. This method is generally called to have an orderly shutdown of the server or if a fatal error has made the physical connection unusable. <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/PooledXQConnection.html#addConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)">addConnectionEventListener</A></B>(<A HREF="../../../javax/xml/xquery/XQConnectionEventListener.html" title="interface in javax.xml.xquery">XQConnectionEventListener</A> listener)</CODE> <BR> Registers the given event listener so that it will be notified when an event occurs on this <code>PooledXQConnection</code> object.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/PooledXQConnection.html#close()">close</A></B>()</CODE> <BR> Closes the physical connection that this <code>PooledXQConnection</code> object represents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../javax/xml/xquery/XQConnection.html" title="interface in javax.xml.xquery">XQConnection</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/PooledXQConnection.html#getConnection()">getConnection</A></B>()</CODE> <BR> Creates and returns an <code>XQConnection</code> object that is a handle for the physical connection that this <code>PooledXQConnection</code> object represents.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../javax/xml/xquery/PooledXQConnection.html#removeConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)">removeConnectionEventListener</A></B>(<A HREF="../../../javax/xml/xquery/XQConnectionEventListener.html" title="interface in javax.xml.xquery">XQConnectionEventListener</A> listener)</CODE> <BR> Removes the given event listener from the list of components that will be notified when an event occurs on this <code>PooledXQConnection</code> object.</TD> </TR> </TABLE> <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getConnection()"><!-- --></A><H3> getConnection</H3> <PRE> <A HREF="../../../javax/xml/xquery/XQConnection.html" title="interface in javax.xml.xquery">XQConnection</A> <B>getConnection</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Creates and returns an <code>XQConnection</code> object that is a handle for the physical connection that this <code>PooledXQConnection</code> object represents. The connection pool manager calls this method when an application has called the <code>XQDataSource</code> method <code>getConnection</code> and there are no <code>PooledXQConnection</code> objects available. <P> <DD><DL> <DT><B>Returns:</B><DD>an <code>XQConnection</code> object that is a handle to this <code>PooledXQConnection</code> object <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if a datasource access error occurs</DL> </DD> </DL> <HR> <A NAME="close()"><!-- --></A><H3> close</H3> <PRE> void <B>close</B>() throws <A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></PRE> <DL> <DD>Closes the physical connection that this <code>PooledXQConnection</code> object represents. An application never calls this method directly; it is called by the connection pool manager. <P> <DD><DL> <DT><B>Throws:</B> <DD><CODE><A HREF="../../../javax/xml/xquery/XQException.html" title="class in javax.xml.xquery">XQException</A></CODE> - if a datasource access error occurs</DL> </DD> </DL> <HR> <A NAME="addConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)"><!-- --></A><H3> addConnectionEventListener</H3> <PRE> void <B>addConnectionEventListener</B>(<A HREF="../../../javax/xml/xquery/XQConnectionEventListener.html" title="interface in javax.xml.xquery">XQConnectionEventListener</A> listener)</PRE> <DL> <DD>Registers the given event listener so that it will be notified when an event occurs on this <code>PooledXQConnection</code> object. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - a component, usually the connection pool manager, that has implemented the <code>XQConnectionEventListener</code> interface and wants to be notified when the connection is closed or has an error<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/xquery/PooledXQConnection.html#removeConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)"><CODE>removeConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)</CODE></A></DL> </DD> </DL> <HR> <A NAME="removeConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)"><!-- --></A><H3> removeConnectionEventListener</H3> <PRE> void <B>removeConnectionEventListener</B>(<A HREF="../../../javax/xml/xquery/XQConnectionEventListener.html" title="interface in javax.xml.xquery">XQConnectionEventListener</A> listener)</PRE> <DL> <DD>Removes the given event listener from the list of components that will be notified when an event occurs on this <code>PooledXQConnection</code> object. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>listener</CODE> - a component, usually the connection pool manager, that has implemented the <code>XQConnectionEventListener</code> interface and been registered with this <code>PooledXQConnection</code> object as a listener<DT><B>See Also:</B><DD><A HREF="../../../javax/xml/xquery/PooledXQConnection.html#addConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)"><CODE>addConnectionEventListener(javax.xml.xquery.XQConnectionEventListener)</CODE></A></DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/xml/xquery/ConnectionPoolXQDataSource.html" title="interface in javax.xml.xquery"><B>PREV CLASS</B></A> <A HREF="../../../javax/xml/xquery/XQCancelledException.html" title="class in javax.xml.xquery"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javax/xml/xquery/PooledXQConnection.html" target="_top"><B>FRAMES</B></A> <A HREF="PooledXQConnection.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright (c) 2004-2011 Saxonica Limited. All rights reserved. </BODY> </HTML>