Java Doc for TransactionSynchronizationRegistry.java in  » EJB-Server-GlassFish » jts » javax » transaction » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » EJB Server GlassFish » jts » javax.transaction 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.transaction.TransactionSynchronizationRegistry

TransactionSynchronizationRegistry
public interface TransactionSynchronizationRegistry (Code)
This interface is intended for use by system level application server components such as persistence managers, resource adapters, as well as EJB 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.

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.
since:
   JTA 1.1





Method Summary
 ObjectgetResource(Object key)
     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.
 booleangetRollbackOnly()
     Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
 ObjectgetTransactionKey()
     Return an opaque object to represent the transaction bound to the current thread at the time this method is called.
 intgetTransactionStatus()
     Return the status of the transaction bound to the current thread at the time this method is called.
 voidputResource(Object key, Object value)
     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.
 voidregisterInterposedSynchronization(Synchronization sync)
     Register a Synchronization instance with special ordering semantics.
 voidsetRollbackOnly()
     Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.



Method Detail
getResource
Object getResource(Object key)(Code)
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 java.util.Map.get(Object) 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.
Parameters:
  key - the key for the Map entry. the value associated with the key.
exception:
  IllegalStateException - if no transaction is active.
exception:
  NullPointerException - if the parameter key is null.
since:
   JTA 1.1



getRollbackOnly
boolean getRollbackOnly()(Code)
Get the rollbackOnly status of the transaction bound to the current thread at the time this method is called. the rollbackOnly status.
exception:
  IllegalStateException - if no transaction is active.
since:
   JTA 1.1



getTransactionKey
Object getTransactionKey()(Code)
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.

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.

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.

The object is not necessarily serializable, and has no defined behavior outside the virtual machine whence it was obtained. an opaque object representing the transaction bound to the current thread at the time this method is called.
since:
   JTA 1.1




getTransactionStatus
int getTransactionStatus()(Code)
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. the status of the transaction bound to the current thread at the time this method is called.
since:
   JTA 1.1



putResource
void putResource(Object key, Object value)(Code)
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 java.util.Map.put(ObjectObject) 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.
Parameters:
  key - the key for the Map entry.
Parameters:
  value - the value for the Map entry.
exception:
  IllegalStateException - if no transaction is active.
exception:
  NullPointerException - if the parameter key is null.
since:
   JTA 1.1



registerInterposedSynchronization
void registerInterposedSynchronization(Synchronization sync)(Code)
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.

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.

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.

If this method is invoked without an active transaction context, an IllegalStateException is thrown.

If this method is invoked after the two-phase commit processing has started, an IllegalStateException is thrown.
Parameters:
  sync - the Synchronization instance.
exception:
  IllegalStateException - if no transaction is active.
since:
   JTA 1.1




setRollbackOnly
void setRollbackOnly()(Code)
Set the rollbackOnly status of the transaction bound to the current thread at the time this method is called.
exception:
  IllegalStateException - if no transaction is active.
since:
   JTA 1.1



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.