Java Doc for XAResource.java in  » Apache-Harmony-Java-SE » javax-package » javax » transaction » xa » 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 » Apache Harmony Java SE » javax package » javax.transaction.xa 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.transaction.xa.XAResource

XAResource
public interface XAResource (Code)
An interface which provides a mapping of the X/Open CAE Specification (for Distributed Transaction processing) into Java. The XAResource interface is used as the interface between a Transaction Manager and a Resource Manager for handling distributed transaction processing.

Typically, a JDBC driver or a JMS driver will implement the XAResource interface to support Global Transactions on a database or on a message connection.



Field Summary
final public static  intTMENDRSCAN
    
final public static  intTMFAIL
    
final public static  intTMJOIN
     Flag to indicate that the caller is joining sn existing transaction branch.
final public static  intTMNOFLAGS
     Flag that indicates that no flags options are selected.
final public static  intTMONEPHASE
    
final public static  intTMRESUME
    
final public static  intTMSTARTRSCAN
    
final public static  intTMSUCCESS
    
final public static  intTMSUSPEND
     Flag that indicates that the caller is suspending (not terminating) its association with a transaction branch.
final public static  intXA_OK
    
final public static  intXA_RDONLY
    


Method Summary
public  voidcommit(Xid xid, boolean onePhase)
     Commits a global transaction.
Parameters:
  xid - the XID which identifies the global transaction
Parameters:
  onePhase - true if the resource manager should use a one-phase commitprotocol to commit the transaction
throws:
  XAException - if an error occurred.

Possible errors are identified by the errorcode in theXAException and include: XA_HEURHAZ, XA_HEURCOM, XA_HEURRB,XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,or XAER_PROTO.

public  voidend(Xid xid, int flags)
     Ends the work done for a transaction branch.
public  voidforget(Xid xid)
     Informs the Resource Manager that it can forget about a specified transaction branch.
Parameters:
  xid - the XID which identifies the global transaction.
throws:
  XAException - if an error occurs.
public  intgetTransactionTimeout()
     Gets the transaction timeout value for this XAResource.
public  booleanisSameRM(XAResource theXAResource)
     Returns true if the ResourceManager for this XAResource is the same as the Resource Manager for a supplied XAResource.
Parameters:
  theXAResource - an XAResource object true if the Resource Manager for this XAResource is the same asthe Resource Manager for theXAResource.
throws:
  XAException - if an error occurs.
public  intprepare(Xid xid)
     Requests the Resource manager to prepare to commit a specified transaction.
Parameters:
  xid - the XID which identifies the global transaction.
public  Xid[]recover(int flag)
     Get a list of prepared transaction branches.

Typically used by a transaction manager during recovery to find transaction branches that are in prepared or heuristically completed states.
Parameters:
  flag - an integer.

public  voidrollback(Xid xid)
     Requests the Resource Manager to rollback a specified transaction branch.
public  booleansetTransactionTimeout(int seconds)
     Sets the transaction timeout value for this XAResource.
public  voidstart(Xid xid, int flags)
     Starts work for a specified transaction branch.
Parameters:
  xid - the XID which identifies the transaction branch.
Parameters:
  flags - an integer.

Field Detail
TMENDRSCAN
final public static int TMENDRSCAN(Code)
Flag to end a recovery scan



TMFAIL
final public static int TMFAIL(Code)
Flag to indicate that the caller is dissociation from a transaction branch and that it should be marked rollback only



TMJOIN
final public static int TMJOIN(Code)
Flag to indicate that the caller is joining sn existing transaction branch.



TMNOFLAGS
final public static int TMNOFLAGS(Code)
Flag that indicates that no flags options are selected. (ie a null flag)



TMONEPHASE
final public static int TMONEPHASE(Code)
Flag that indicates the caller is using one-phase commit optimization



TMRESUME
final public static int TMRESUME(Code)
Flag that indicates the caller is resuming association with a suspended transaction branch



TMSTARTRSCAN
final public static int TMSTARTRSCAN(Code)
Flag that indicates the start of a recovery scan



TMSUCCESS
final public static int TMSUCCESS(Code)
Flag that indicates the caller is dissociating from a transaction branch



TMSUSPEND
final public static int TMSUSPEND(Code)
Flag that indicates that the caller is suspending (not terminating) its association with a transaction branch.



XA_OK
final public static int XA_OK(Code)
Flag that indicates that transaction work has been Prepared normally



XA_RDONLY
final public static int XA_RDONLY(Code)
Flag that indicates that transaction work has been read only and has been committed normally





Method Detail
commit
public void commit(Xid xid, boolean onePhase) throws XAException(Code)
Commits a global transaction.
Parameters:
  xid - the XID which identifies the global transaction
Parameters:
  onePhase - true if the resource manager should use a one-phase commitprotocol to commit the transaction
throws:
  XAException - if an error occurred.

Possible errors are identified by the errorcode in theXAException and include: XA_HEURHAZ, XA_HEURCOM, XA_HEURRB,XA_HEURMIX, XAER_RMERR, XAER_RMFAIL, XAER_NOTA, XAER_INVAL,or XAER_PROTO. In addition, one of the XA_RB* errors canoccur if the transaction was not committed andonePhase was set to true. On completion ofthis method, the Resource Manager has rolled back thetransaction and released resources held by the transaction.




end
public void end(Xid xid, int flags) throws XAException(Code)
Ends the work done for a transaction branch. The Resource Manager disconnects the XA resource from the transaction branch and allows the transaction to complete.
Parameters:
  xid - the XID which identifies the global transaction. Should havepreviously been used as the parameter to a startmethod.
Parameters:
  flags - a flags integer - one of: XAResource.TMSUCCESS,XAResource.TMFAIL, or XAResource.TMSUSPEND.

TMSUCCESS means that this section of work completedsuccessfully.

TMFAIL means that this section of work failed. The ResourceManager can mark the transaction for rollback only.

TMSUSPEND means that this section of work is suspended and notyet complete. The associated transaction context is alsosuspended and must be restarted with a call toXAResource.start(Xid,int) with the TMRESUMEflag.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XAER_RMERR, XAER_RMFAIL, XAER_NOTA,XAER_INVAL, XAER_PROTO, or XA_RB*.




forget
public void forget(Xid xid) throws XAException(Code)
Informs the Resource Manager that it can forget about a specified transaction branch.
Parameters:
  xid - the XID which identifies the global transaction.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XAER_RMERR, XAER_RMFAIL, XAER_NOTA,XAER_INVAL, or XAER_PROTO.



getTransactionTimeout
public int getTransactionTimeout() throws XAException(Code)
Gets the transaction timeout value for this XAResource. The default timeout value is the default timeout value set for the Resource Manager. the transaction timeout value for this XAResource in seconds.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XAER_RMERR and XAER_RMFAIL.



isSameRM
public boolean isSameRM(XAResource theXAResource) throws XAException(Code)
Returns true if the ResourceManager for this XAResource is the same as the Resource Manager for a supplied XAResource.
Parameters:
  theXAResource - an XAResource object true if the Resource Manager for this XAResource is the same asthe Resource Manager for theXAResource.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XAER_RMERR and XAER_RMFAIL.



prepare
public int prepare(Xid xid) throws XAException(Code)
Requests the Resource manager to prepare to commit a specified transaction.
Parameters:
  xid - the XID which identifies the global transaction. an integer: XA_RDONLY or XA_OK. XA_OK implies that thetransaction work has been prepared normally, XA_RDONLY impliesthat the transaction branch is read only and has been committed.If there is a failure which requires a rollback, an XAExceptionis raised.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XA_RB*, XAER_RMERR, XAER_RMFAIL,XAER_NOTA, XAER_INVAL, or XAER_PROTO.



recover
public Xid[] recover(int flag) throws XAException(Code)
Get a list of prepared transaction branches.

Typically used by a transaction manager during recovery to find transaction branches that are in prepared or heuristically completed states.
Parameters:
  flag - an integer. Must be one of: XAResource.TMSTARTRSCAN,XAResource.TMENDRSCAN, XAResource.TMNOFLAGS. an array of zero or more XIDs identifying the transactionbranches in the prepared or heuristically completed states.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XAER_RMERR, XAER_RMFAIL, XAER_INVAL, andXAER_PROTO.




rollback
public void rollback(Xid xid) throws XAException(Code)
Requests the Resource Manager to rollback a specified transaction branch.
Parameters:
  xid - the XID which identifies the transaction branch.
throws:
  XAException - if an error occurs.



setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException(Code)
Sets the transaction timeout value for this XAResource. If the value is set to 0, the default timeout value for the Resource Manager is used.
Parameters:
  seconds - the new Timeout value in seconds true if the transaction timeout value has been updated, falseotherwise.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XAER_RMERR, XAER_RMFAIL, or XAER_INVAL.



start
public void start(Xid xid, int flags) throws XAException(Code)
Starts work for a specified transaction branch.
Parameters:
  xid - the XID which identifies the transaction branch.
Parameters:
  flags - an integer. Must be one of XAResource.TMNOFLAGS,XAResource.TMJOIN, or XAResource.TMRESUME.

TMJOIN implies that the start applies to joining a transactionpreviously passed to the Resource Manager.

TMRESUME implies that the start applies to a suspendedtransaction that should be restarted.

If TMNOFLAGS is specified, then if the transaction has beenpreviously seen by the Resource Manager, an XAException israised with the code XAER_DUPID.
throws:
  XAException - if an error occurs. Possible error identified in theerrorcode include: XA_RB*, XAER_RMERR, XAER_RMFAIL,XAER_DUPID, XAER_OUTSIDE, XAER_NOTA, XAER_INVAL, orXAER_PROTO.




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