transactionsynchronizationregistry.html
来自「j2ee帮助文档软件设计/软件工程 文件格式」· HTML 代码 · 共 467 行 · 第 1/2 页
HTML
467 行
<DD><DL><DT><B>Returns:</B><DD>an opaque object representing the transaction bound to the current thread at the time this method is called.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></DL></DD></DL><HR><A NAME="putResource(java.lang.Object, java.lang.Object)"><!-- --></A><H3>putResource</H3><PRE>void <B>putResource</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> key, <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> value)</PRE><DL><DD>Add or replace an object in the Map of resources being managed for the transaction bound to the current thread at the time this method is called. The supplied key should be of an caller- defined class so as not to conflict with other users. The class of the key must guarantee that the hashCode and equals methods are suitable for use as keys in a map. The key and value are not examined or used by the implementation. The general contract of this method is that of <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Map.html#put(K, V)" title="class or interface in java.util"><CODE>Map.put(Object, Object)</CODE></A> for a Map that supports non-null keys and null values. For example, if there is already an value associated with the key, it is replaced by the value parameter.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key for the Map entry.<DD><CODE>value</CODE> - the value for the Map entry.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if no transaction is active.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if the parameter key is null.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></DL></DD></DL><HR><A NAME="getResource(java.lang.Object)"><!-- --></A><H3>getResource</H3><PRE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>getResource</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> key)</PRE><DL><DD>Get an object from the Map of resources being managed for the transaction bound to the current thread at the time this method is called. The key should have been supplied earlier by a call to putResouce in the same transaction. If the key cannot be found in the current resource Map, null is returned. The general contract of this method is that of <A HREF="http://java.sun.com/j2se/1.5/docs/api/java/util/Map.html#get(java.lang.Object)" title="class or interface in java.util"><CODE>Map.get(Object)</CODE></A> for a Map that supports non-null keys and null values. For example, the returned value is null if there is no entry for the parameter key or if the value associated with the key is actually null.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>key</CODE> - the key for the Map entry.<DT><B>Returns:</B><DD>the value associated with the key.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if no transaction is active.<DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if the parameter key is null.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></DL></DD></DL><HR><A NAME="registerInterposedSynchronization(javax.transaction.Synchronization)"><!-- --></A><H3>registerInterposedSynchronization</H3><PRE>void <B>registerInterposedSynchronization</B>(<A HREF="../../javax/transaction/Synchronization.html" title="interface in javax.transaction">Synchronization</A> sync)</PRE><DL><DD>Register a Synchronization instance with special ordering semantics. Its beforeCompletion will be called after all SessionSynchronization beforeCompletion callbacks and callbacks registered directly with the Transaction, but before the 2-phase commit process starts. Similarly, the afterCompletion callback will be called after 2-phase commit completes but before any SessionSynchronization and Transaction afterCompletion callbacks. <P>The beforeCompletion callback will be invoked in the transaction context of the transaction bound to the current thread at the time this method is called. Allowable methods include access to resources, e.g. Connectors. No access is allowed to "user components" (e.g. timer services or bean methods), as these might change the state of data being managed by the caller, and might change the state of data that has already been flushed by another caller of registerInterposedSynchronization. The general context is the component context of the caller of registerInterposedSynchronization. <P>The afterCompletion callback will be invoked in an undefined context. No access is permitted to "user components" as defined above. Resources can be closed but no transactional work can be performed with them. <P>If this method is invoked without an active transaction context, an IllegalStateException is thrown. <P>If this method is invoked after the two-phase commit processing has started, an IllegalStateException is thrown.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>sync</CODE> - the Synchronization instance.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if no transaction is active.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></DL></DD></DL><HR><A NAME="getTransactionStatus()"><!-- --></A><H3>getTransactionStatus</H3><PRE>int <B>getTransactionStatus</B>()</PRE><DL><DD>Return the status of the transaction bound to the current thread at the time this method is called. This is the result of executing TransactionManager.getStatus() in the context of the transaction bound to the current thread at the time this method is called.<P><DD><DL><DT><B>Returns:</B><DD>the status of the transaction bound to the current thread at the time this method is called.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></DL></DD></DL><HR><A NAME="setRollbackOnly()"><!-- --></A><H3>setRollbackOnly</H3><PRE>void <B>setRollbackOnly</B>()</PRE><DL><DD>Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if no transaction is active.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></DL></DD></DL><HR><A NAME="getRollbackOnly()"><!-- --></A><H3>getRollbackOnly</H3><PRE>boolean <B>getRollbackOnly</B>()</PRE><DL><DD>Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.<P><DD><DL><DT><B>Returns:</B><DD>the rollbackOnly status.<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.5/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if no transaction is active.<DT><B>Since:</B></DT> <DD>JTA 1.1</DD></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/transaction/TransactionRolledbackException.html" title="class in javax.transaction"><B>PREV CLASS</B></A> <A HREF="../../javax/transaction/UserTransaction.html" title="interface in javax.transaction"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javax/transaction/TransactionSynchronizationRegistry.html" target="_top"><B>FRAMES</B></A> <A HREF="TransactionSynchronizationRegistry.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><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to <a href="../legal/license.html" target="_top">license terms.</a></font></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?