| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <title>TransactionSynchronizationRegistry</title> |
| <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="TransactionSynchronizationRegistry"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../javax/transaction/TransactionScoped.html" title="annotation in javax.transaction"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../javax/transaction/UserTransaction.html" title="interface in javax.transaction"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?javax/transaction/TransactionSynchronizationRegistry.html" target="_top">Frames</a></li> |
| <li><a href="TransactionSynchronizationRegistry.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">javax.transaction</div> |
| <h2 title="Interface TransactionSynchronizationRegistry" class="title">Interface TransactionSynchronizationRegistry</h2> |
| </div> |
| <div class="contentContainer"> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Known Implementing Classes:</dt> |
| <dd><a href="../../org/apache/openejb/ri/sp/PseudoTransactionService.html" title="class in org.apache.openejb.ri.sp">PseudoTransactionService</a>, <a href="../../org/apache/openejb/core/SimpleTransactionSynchronizationRegistry.html" title="class in org.apache.openejb.core">SimpleTransactionSynchronizationRegistry</a>, <a href="../../org/apache/openejb/core/TransactionSynchronizationRegistryWrapper.html" title="class in org.apache.openejb.core">TransactionSynchronizationRegistryWrapper</a></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public interface <span class="typeNameLabel">TransactionSynchronizationRegistry</span></pre> |
| <div class="block">This interface is intended for use by system level application server |
| components such as persistence managers, resource adapters, as well as |
| Jakarta Enterprise Beans and Web application components. This provides the ability to |
| register synchronization objects with special ordering semantics, |
| associate resource objects with the current transaction, get the |
| transaction context of the current transaction, get current transaction |
| status, and mark the current transaction for rollback. |
| |
| This interface is implemented by the application server by a |
| stateless service object. The same object can be used by any number of |
| components with thread safety. |
| |
| <P>In standard application server environments, an instance |
| implementing this interface can be looked up by a standard name via JNDI. |
| The standard name is java:comp/TransactionSynchronizationRegistry.</div> |
| <dl> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#getResource-java.lang.Object-">getResource</a></span>(java.lang.Object key)</code> |
| <div class="block">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.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#getRollbackOnly--">getRollbackOnly</a></span>()</code> |
| <div class="block">Get the rollbackOnly status of the transaction bound to the |
| current thread at the time this method is called.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>java.lang.Object</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#getTransactionKey--">getTransactionKey</a></span>()</code> |
| <div class="block">Return an opaque object to represent the transaction bound to the |
| current thread at the time this method is called.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#getTransactionStatus--">getTransactionStatus</a></span>()</code> |
| <div class="block">Return the status of the transaction bound to the |
| current thread at the time this method is called.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#putResource-java.lang.Object-java.lang.Object-">putResource</a></span>(java.lang.Object key, |
| java.lang.Object value)</code> |
| <div class="block">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.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#registerInterposedSynchronization-javax.transaction.Synchronization-">registerInterposedSynchronization</a></span>(<a href="../../javax/transaction/Synchronization.html" title="interface in javax.transaction">Synchronization</a> sync)</code> |
| <div class="block">Register a Synchronization instance with special ordering |
| semantics.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../javax/transaction/TransactionSynchronizationRegistry.html#setRollbackOnly--">setRollbackOnly</a></span>()</code> |
| <div class="block">Set the rollbackOnly status of the transaction bound to the |
| current thread at the time this method is called.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="getTransactionKey--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getTransactionKey</h4> |
| <pre>java.lang.Object getTransactionKey()</pre> |
| <div class="block">Return an opaque object to represent the transaction bound to the |
| current thread at the time this method is called. This object |
| overrides hashCode and equals to allow its use as the key in a |
| hashMap for use by the caller. If there is no transaction currently |
| active, return null. |
| |
| <P>This object will return the same hashCode and compare equal to |
| all other objects returned by calling this method |
| from any component executing in the same transaction context in the |
| same application server. |
| |
| <P>The toString method returns a String that might be usable by a |
| human reader to usefully understand the transaction context. The |
| toString result is otherwise not defined. Specifically, there is no |
| forward or backward compatibility guarantee of the results of |
| toString. |
| |
| <P>The object is not necessarily serializable, and has no defined |
| behavior outside the virtual machine whence it was obtained.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>an opaque object representing the transaction bound to the |
| current thread at the time this method is called.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="putResource-java.lang.Object-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>putResource</h4> |
| <pre>void putResource(java.lang.Object key, |
| java.lang.Object value)</pre> |
| <div class="block">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 <code>Map.put(Object, Object)</code> 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.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>key</code> - the key for the Map entry.</dd> |
| <dd><code>value</code> - the value for the Map entry.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if no transaction is active.</dd> |
| <dd><code>java.lang.NullPointerException</code> - if the parameter key is null.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getResource-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getResource</h4> |
| <pre>java.lang.Object getResource(java.lang.Object key)</pre> |
| <div class="block">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 <code>Map.get(Object)</code> 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.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>key</code> - the key for the Map entry.</dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the value associated with the key.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if no transaction is active.</dd> |
| <dd><code>java.lang.NullPointerException</code> - if the parameter key is null.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="registerInterposedSynchronization-javax.transaction.Synchronization-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>registerInterposedSynchronization</h4> |
| <pre>void registerInterposedSynchronization(<a href="../../javax/transaction/Synchronization.html" title="interface in javax.transaction">Synchronization</a> sync)</pre> |
| <div class="block">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.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>sync</code> - the Synchronization instance.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if no transaction is active.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getTransactionStatus--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getTransactionStatus</h4> |
| <pre>int getTransactionStatus()</pre> |
| <div class="block">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.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the status of the transaction bound to the current thread |
| at the time this method is called.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setRollbackOnly--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setRollbackOnly</h4> |
| <pre>void setRollbackOnly()</pre> |
| <div class="block">Set the rollbackOnly status of the transaction bound to the |
| current thread at the time this method is called.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if no transaction is active.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getRollbackOnly--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getRollbackOnly</h4> |
| <pre>boolean getRollbackOnly()</pre> |
| <div class="block">Get the rollbackOnly status of the transaction bound to the |
| current thread at the time this method is called.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>the rollbackOnly status.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.lang.IllegalStateException</code> - if no transaction is active.</dd> |
| <dt><span class="simpleTagLabel">Since:</span></dt> |
| <dd>JTA 1.1</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../index-all.html">Index</a></li> |
| <li><a href="../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../javax/transaction/TransactionScoped.html" title="annotation in javax.transaction"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../javax/transaction/UserTransaction.html" title="interface in javax.transaction"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../index.html?javax/transaction/TransactionSynchronizationRegistry.html" target="_top">Frames</a></li> |
| <li><a href="TransactionSynchronizationRegistry.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li>Constr | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |