managedconnection.html
来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 495 行 · 第 1/2 页
HTML
495 行
destroy</H3>
<PRE>
public void <B>destroy</B>()
throws <A HREF="../../../javax/resource/ResourceException.html">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.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation failed<DD><CODE><A HREF="../../../javax/resource/spi/IllegalStateException.html">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">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.<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html">ResourceAdapterInternalException</A></CODE> - resource adapter internal error condition<DD><CODE><A HREF="../../../javax/resource/spi/IllegalStateException.html">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>(java.lang.Object connection)
throws <A HREF="../../../javax/resource/ResourceException.html">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.<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">ResourceException</A></CODE> - Failed to associate the connection
handle with this ManagedConnection
instance<DD><CODE><A HREF="../../../javax/resource/spi/IllegalStateException.html">IllegalStateException</A></CODE> - Illegal state for invoking this
method<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html">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">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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - a new ConnectionEventListener to be registered</DL>
</DD>
</DL>
<HR>
<A NAME="removeConnectionEventListener(javax.resource.spi.ConnectionEventListener)"><!-- --></A><H3>
removeConnectionEventListener</H3>
<PRE>
public void <B>removeConnectionEventListener</B>(<A HREF="../../../javax/resource/spi/ConnectionEventListener.html">ConnectionEventListener</A> listener)</PRE>
<DL>
<DD>Removes an already registered connection event listener from the
ManagedConnection instance.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>listener</CODE> - already registered connection event listener to be
removed</DL>
</DD>
</DL>
<HR>
<A NAME="getXAResource()"><!-- --></A><H3>
getXAResource</H3>
<PRE>
public <A HREF="../../../javax/transaction/xa/XAResource.html">XAResource</A> <B>getXAResource</B>()
throws <A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></PRE>
<DL>
<DD>Returns an <code>javax.transaction.xa.XAresource</code> instance.
An application server enlists this XAResource instance with the
Transaction Manager if the ManagedConnection instance is being used
in a JTA transaction that is being coordinated by the Transaction
Manager.<DD><DL>
<DT><B>Returns:</B><DD>XAResource instance<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE>NotSupportedException</CODE> - if the operation is not supported<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html">ResourceAdapterInternalException</A></CODE> - resource adapter internal error condition</DL>
</DD>
</DL>
<HR>
<A NAME="getLocalTransaction()"><!-- --></A><H3>
getLocalTransaction</H3>
<PRE>
public <A HREF="../../../javax/resource/spi/LocalTransaction.html">LocalTransaction</A> <B>getLocalTransaction</B>()
throws <A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></PRE>
<DL>
<DD>Returns an <code>javax.resource.spi.LocalTransaction</code> instance.
The LocalTransaction interface is used by the container to manage
local transactions for a RM instance.<DD><DL>
<DT><B>Returns:</B><DD>LocalTransaction instance<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE>NotSupportedException</CODE> - if the operation is not supported<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html">ResourceAdapterInternalException</A></CODE> - resource adapter internal error condition</DL>
</DD>
</DL>
<HR>
<A NAME="getMetaData()"><!-- --></A><H3>
getMetaData</H3>
<PRE>
public <A HREF="../../../javax/resource/spi/ManagedConnectionMetaData.html">ManagedConnectionMetaData</A> <B>getMetaData</B>()
throws <A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></PRE>
<DL>
<DD><p>Gets the metadata information for this connection's underlying
EIS resource manager instance. The ManagedConnectionMetaData
interface provides information about the underlying EIS instance
associated with the ManagedConenction instance.<DD><DL>
<DT><B>Returns:</B><DD>ManagedConnectionMetaData instance<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE>NotSupportedException</CODE> - if the operation is not supported</DL>
</DD>
</DL>
<HR>
<A NAME="setLogWriter(java.io.PrintWriter)"><!-- --></A><H3>
setLogWriter</H3>
<PRE>
public void <B>setLogWriter</B>(java.io.PrintWriter out)
throws <A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></PRE>
<DL>
<DD>Sets the log writer for this ManagedConnection instance.
<p>The log writer is a character output stream to which all logging and
tracing messages for this ManagedConnection instance will be printed.
Application Server manages the association of output stream with the
ManagedConnection instance based on the connection pooling
requirements.</p>
<p>When a ManagedConnection object is initially created, the default
log writer associated with this instance is obtained from the
ManagedConnectionFactory. An application server can set a log writer
specific to this ManagedConnection to log/trace this instance using
setLogWriter method.</p><DD><DL>
<DT><B>Parameters:</B><DD><CODE>out</CODE> - Character Output stream to be associated<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation fails<DD><CODE><A HREF="../../../javax/resource/spi/ResourceAdapterInternalException.html">ResourceAdapterInternalException</A></CODE> - resource adapter related error condition</DL>
</DD>
</DL>
<HR>
<A NAME="getLogWriter()"><!-- --></A><H3>
getLogWriter</H3>
<PRE>
public java.io.PrintWriter <B>getLogWriter</B>()
throws <A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></PRE>
<DL>
<DD>Gets the log writer for this ManagedConnection instance.
<p>The log writer is a character output stream to which all logging and
tracing messages for this ManagedConnection instance will be printed.
ConnectionManager manages the association of output stream with the
ManagedConnection instance based on the connection pooling
requirements.</p>
<p>The Log writer associated with a ManagedConnection instance can be
one set as default from the ManagedConnectionFactory (that created
this connection) or one set specifically for this instance by the
application server.</p><DD><DL>
<DT><B>Returns:</B><DD>Character ourput stream associated with this Managed-
Connection instance<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/resource/ResourceException.html">ResourceException</A></CODE> - generic exception if operation fails</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<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/resource/spi/LocalTransaction.html"><B>PREV CLASS</B></A>
<A HREF="../../../javax/resource/spi/ManagedConnectionFactory.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="ManagedConnection.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | 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>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?