📄 managedconnection.html
字号:
</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/resource/spi/ManagedConnectionMetaData.html" title="interface in javax.resource.spi">ManagedConnectionMetaData</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/resource/spi/ManagedConnection.html#getMetaData()">getMetaData</A></B>()</CODE><BR> Gets the metadata information for this connection's underlying EIS resource manager instance. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/transaction/xa/XAResource.html" title="interface in javax.transaction.xa">XAResource</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/resource/spi/ManagedConnection.html#getXAResource()">getXAResource</A></B>()</CODE><BR> Returns an <code>javax.transaction.xa.XAresource</code> instance. </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/resource/spi/ManagedConnection.html#removeConnectionEventListener(javax.resource.spi.ConnectionEventListener)">removeConnectionEventListener</A></B>(<A HREF="../../../javax/resource/spi/ConnectionEventListener.html" title="interface in javax.resource.spi">ConnectionEventListener</A> listener)</CODE><BR> Removes an already registered connection event listener from the ManagedConnection instance.</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/resource/spi/ManagedConnection.html#setLogWriter(java.io.PrintWriter)">setLogWriter</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/PrintWriter.html" title="class or interface in java.io">PrintWriter</A> out)</CODE><BR> Sets the log writer for this ManagedConnection instance. </TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getConnection(javax.security.auth.Subject, javax.resource.spi.ConnectionRequestInfo)"><!-- --></A><H3>getConnection</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getConnection</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/javax/security/auth/Subject.html" title="class or interface in javax.security.auth">Subject</A> subject, <A HREF="../../../javax/resource/spi/ConnectionRequestInfo.html" title="interface in javax.resource.spi">ConnectionRequestInfo</A> cxRequestInfo) throws <A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></PRE><DL><DD>Creates a new connection handle for the underlying physical connection represented by the ManagedConnection instance. This connection handle is used by the application code to refer to the underlying physical connection. This connection handle is associated with its ManagedConnection instance in a resource adapter implementation specific way.</P> <P>The ManagedConnection uses the Subject and additional ConnectionRequest Info (which is specific to resource adapter and opaque to application server) to set the state of the physical connection.</p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>subject</CODE> - security context as JAAS subject<DD><CODE>cxRequestInfo</CODE> - ConnectionRequestInfo instance<DT><B>Returns:</B><DD>generic Object instance representing the connection handle. For CCI, the connection handle created by a ManagedConnection instance is of the type javax.resource.cci.Connection.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html" title="class in javax.resource.spi">ResourceAdapterInternalException</A></CODE> - resource adapter internal error condition<DD><CODE><A HREF="../../../javax/resource/spi/SecurityException.html" title="class in javax.resource.spi">SecurityException</A></CODE> - security related error condition<DD><CODE><A HREF="../../../javax/resource/spi/CommException.html" title="class in javax.resource.spi">CommException</A></CODE> - failed communication with EIS instance<DD><CODE><A HREF="../../../javax/resource/spi/EISSystemException.html" title="class in javax.resource.spi">EISSystemException</A></CODE> - internal error condition in EIS instance - used if EIS instance is involved in setting state of ManagedConnection</DL></DD></DL><HR><A NAME="destroy()"><!-- --></A><H3>destroy</H3><PRE>public void <B>destroy</B>() throws <A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></PRE><DL><DD>Destroys the physical connection to the underlying resource manager. <p>To manage the size of the connection pool, an application server can explictly call ManagedConnection.destroy to destroy a physical connection. A resource adapter should destroy all allocated system resources for this ManagedConnection instance when the method destroy is called.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></CODE> - generic exception if operation failed<DD><CODE><A HREF="../../../javax/resource/spi/IllegalStateException.html" title="class in javax.resource.spi">IllegalStateException</A></CODE> - illegal state for destroying connection</DL></DD></DL><HR><A NAME="cleanup()"><!-- --></A><H3>cleanup</H3><PRE>public void <B>cleanup</B>() throws <A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></PRE><DL><DD>Application server calls this method to force any cleanup on the ManagedConnection instance. <p>The method ManagedConnection.cleanup initiates a cleanup of the any client-specific state as maintained by a ManagedConnection instance. The cleanup should invalidate all connection handles that had been created using this ManagedConnection instance. Any attempt by an application component to use the connection handle after cleanup of the underlying ManagedConnection should result in an exception. <p>The cleanup of ManagedConnection is always driven by an application server. An application server should not invoke ManagedConnection.cleanup when there is an uncompleted transaction (associated with a ManagedConnection instance) in progress. <p>The invocation of ManagedConnection.cleanup method on an already cleaned-up connection should not throw an exception. <p>The cleanup of ManagedConnection instance resets its client specific state and prepares the connection to be put back in to a connection pool. The cleanup method should not cause resource adapter to close the physical pipe and reclaim system resources associated with the physical connection.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html" title="class in javax.resource.spi">ResourceAdapterInternalException</A></CODE> - resource adapter internal error condition<DD><CODE><A HREF="../../../javax/resource/spi/IllegalStateException.html" title="class in javax.resource.spi">IllegalStateException</A></CODE> - Illegal state for calling connection cleanup. Example - if a localtransaction is in progress that doesn't allow connection cleanup</DL></DD></DL><HR><A NAME="associateConnection(java.lang.Object)"><!-- --></A><H3>associateConnection</H3><PRE>public void <B>associateConnection</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> connection) throws <A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></PRE><DL><DD>Used by the container to change the association of an application-level connection handle with a ManagedConneciton instance. The container should find the right ManagedConnection instance and call the associateConnection method. <p>The resource adapter is required to implement the associateConnection method. The method implementation for a ManagedConnection should dissociate the connection handle (passed as a parameter) from its currently associated ManagedConnection and associate the new connection handle with itself.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>connection</CODE> - Application-level connection handle<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html" title="class in javax.resource">ResourceException</A></CODE> - Failed to associate the connection handle with this ManagedConnection instance<DD><CODE><A HREF="../../../javax/resource/spi/IllegalStateException.html" title="class in javax.resource.spi">IllegalStateException</A></CODE> - Illegal state for invoking this method<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html" title="class in javax.resource.spi">ResourceAdapterInternalException</A></CODE> - Resource adapter internal error condition</DL></DD></DL><HR><A NAME="addConnectionEventListener(javax.resource.spi.ConnectionEventListener)"><!-- --></A><H3>addConnectionEventListener</H3><PRE>public void <B>addConnectionEventListener</B>(<A HREF="../../../javax/resource/spi/ConnectionEventListener.html" title="interface in javax.resource.spi">ConnectionEventListener</A> listener)</PRE><DL><DD>Adds a connection event listener to the ManagedConnection instance. <p>The registered ConnectionEventListener instances are notified of connection close and error events, also of local transaction related events on the Managed Connection.<P><DD><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -