Java Doc for Current.java in  » Database-JDBC-Connection-Pool » jotm-2.0.10 » org » objectweb » jotm » 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 » Database JDBC Connection Pool » jotm 2.0.10 » org.objectweb.jotm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.jotm.Current

Current
public class Current implements UserTransaction,TransactionManager,Referenceable,Serializable(Code)
Current is the common implementation for both UserTransaction and TransactionManager.
  • UserTransaction is used by clients that want to demarcate transactions themselves. It is referenceable through JNDI.
  • TransactionManager is used by an application server.

This object is unique in a VM, i. e. each application server has ONE Current object and each client program should normally issue only ONE lookup on JNDI.

Current also implements Referenceable and Serializable because of JNDI.




Constructor Summary
public  Current()
     Default constructor.
public  Current(TransactionFactory tmfact)
     Constructor for an application server.

Method Summary
public  intactionXAResource(String xaAction, String xatx)
    
public  voidassociateThreadTx(Xid xid)
     Associate Thread to this transaction.
public  voidbegin()
     Creates a new transaction and associate it with the current thread.
exception:
  NotSupportedException - Thrown if the thread is alreadyassociated with a transaction.
public  voidbegin(javax.transaction.xa.Xid passxid)
     Creates a new inflow transaction and associates it with the current thread.
Parameters:
  passxid - Xid of the inflow transaction.
exception:
  NotSupportedException - Thrown if the thread is alreadyassociated with a transaction.
public  voidbegin(javax.transaction.xa.Xid passxid, long timeout)
     Creates a new inflow transaction and associates it with the current thread.
Parameters:
  passxid - Xid of the inflow transaction.
Parameters:
  timeout - value of the timeout (in seconds).
public  voidclearThreadTx()
     Clear transaction from this thread if not known.
public  voidcommit()
     Commits the transaction associated with the current thread.
public  voidconnectionClosed(ResourceManagerEvent event)
    
public  voidconnectionErrorOccured(ResourceManagerEvent event)
    
public  voidconnectionOpened(ResourceManagerEvent event)
    
 voidforget()
    
public  voidforgetTx(Xid xid)
     Forget all about this transaction.
public  String[]getAllRcTx()
     Get all Transactions that may require recovery.
public  String[]getAllTx()
     Get all executing transactions.
public  String[]getAllXaTx(String stx)
     Get all XAResources that may require recovery.
public  javax.transaction.xa.Xid[]getAllXid()
     Get all Xid's associated with this transaction.
public static  CurrentgetCurrent()
     Returns the unique instance of the class or null if not initialized in case of plain client.
public static  booleangetDefaultRecovery()
    
public  intgetDefaultTimeout()
    
public static  TransactionFactorygetJTM()
    
public  javax.transaction.xa.Xid[]getPreparedHeuristicXid()
     Get the Xid's of all prepared transactions.
public  TransactionContextgetPropagationContext(boolean hold)
     Get the transaction context associated with the current thread or null if the thread is not involved in a transaction.
public  ReferencegetReference()
     Retrieves the Reference of this object.
public  intgetStatus()
     Returns the status of the transaction associated with the current thread. transaction status.
public  intgetTotalBegunTransactions()
     Returns the total number of begun transactions.
public  intgetTotalCommittedTransactions()
     Returns the total number of committed transactions.
public  intgetTotalCurrentTransactions()
     Returns the current number of transactions.
public  intgetTotalExpiredTransactions()
     Returns the total number of rolled back transactions due to timeout.
public  intgetTotalRolledbackTransactions()
     Returns the total number of rolled back transactions.
public  TransactiongetTransaction()
     Gets the transaction object that represents the transaction context of the calling thread. the Transaction object representing the transaction associated with the calling thread.
public synchronized  Integer[]getTransactionCounters()
     Returns all counters.
public static  TransactionManagergetTransactionManager()
     Gets the TransactionManager instance.
public static  TransactionRecoverygetTransactionRecovery()
    
public  TransactionImplgetTxByXid(Xid xid)
     Get the transaction referenced by Xid.
public  XATerminatorgetXATerminator()
     Gets the inflow transaction object that represents the transaction context of the calling thread. the XATerminator object representing the inflow transaction associated with the calling thread.
synchronized  voidincrementBeginCounter()
     Increments number of begun transactions by one.
synchronized  voidincrementCommitCounter()
     Increments the number of of committed transactions by one.
synchronized  voidincrementExpiredCounter()
     Increments number of rolled back transactions due to timeout by one.
synchronized  voidincrementRollbackCounter()
     Increments the number of rolled back transaction by one.
public  ListpopThreadLocalRMEventList()
    
public  voidpushThreadLocalRMEventList(List eventList)
    
public synchronized  voidresetAllTxTotalCounters()
     Resets total number of transactions.
public  voidresume(Transaction tobj)
     Resumes the transaction context association of the calling thread with the transaction represented by the supplied Transaction object.
public  voidrollback()
     Rolls back the transaction associated with the current thread.
public static  voidsetDefaultRecovery(boolean recovery)
    
public  voidsetDefaultTimeout(int timeout)
    
public  voidsetPropagationContext(TransactionContext pctx, boolean isReply)
     Associate to the current thread a transaction represented by its transaction context.
public  voidsetRollbackOnly()
     Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
public  voidsetTransactionRecovery(boolean recovery)
     Modifies the value of the recovery value that is associated with the transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses the default value of 'false' for recovery.
Parameters:
  recovery - value of the recovery (true or faluse).
public  voidsetTransactionTimeout(int timeout)
     Modifies the value of the timeout value that is associated with the transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses some default value for the transaction timeout.
Parameters:
  timeout - value of the timeout (in seconds).
public  Transactionsuspend()
     Suspends the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended.


Constructor Detail
Current
public Current()(Code)
Default constructor. A client does not need the TMFactory.



Current
public Current(TransactionFactory tmfact)(Code)
Constructor for an application server. The TM factory is passed as an argument. Note that the TM factory can be either local or remote.
Parameters:
  tmfact - TM Factory to use




Method Detail
actionXAResource
public int actionXAResource(String xaAction, String xatx)(Code)
Returns all XAResources that require administrator recovery action.



associateThreadTx
public void associateThreadTx(Xid xid)(Code)
Associate Thread to this transaction. (used by iiop interceptor)



begin
public void begin() throws NotSupportedException, SystemException(Code)
Creates a new transaction and associate it with the current thread.
exception:
  NotSupportedException - Thrown if the thread is alreadyassociated with a transaction. (nested transaction are notsupported)
exception:
  SystemException - Thrown if the transaction manager encounters an unexpected error condition



begin
public void begin(javax.transaction.xa.Xid passxid) throws NotSupportedException, SystemException(Code)
Creates a new inflow transaction and associates it with the current thread.
Parameters:
  passxid - Xid of the inflow transaction.
exception:
  NotSupportedException - Thrown if the thread is alreadyassociated with a transaction. (nested transaction are notsupported)
exception:
  SystemException - Thrown if the transaction manager encounters an unexpected error condition



begin
public void begin(javax.transaction.xa.Xid passxid, long timeout) throws NotSupportedException, SystemException(Code)
Creates a new inflow transaction and associates it with the current thread.
Parameters:
  passxid - Xid of the inflow transaction.
Parameters:
  timeout - value of the timeout (in seconds). If the value is less than or equal to zero, the value will be set to the default value.
exception:
  NotSupportedException - Thrown if the thread is alreadyassociated with a transaction. (nested transaction are notsupported)
exception:
  SystemException - Thrown if the transaction manager encounters an unexpected error condition



clearThreadTx
public void clearThreadTx()(Code)
Clear transaction from this thread if not known. Useful when another thread completes the current thread's transaction



commit
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException(Code)
Commits the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction.
exception:
  RollbackException - Thrown to indicate that the transactionhas been rolled back rather than committed.
exception:
  HeuristicMixedException - Thrown to indicate that a heuristicdecision was made and that some relevant updates have been committedwhile others have been rolled back.
exception:
  HeuristicRollbackException - Thrown to indicate that aheuristic decision was made and that some relevant updates have beenrolled back.
exception:
  SecurityException - Thrown to indicate that the thread is notallowed to commit the transaction.
exception:
  IllegalStateException - Thrown if the current thread is notassociated with a transaction.
exception:
  SystemException - Thrown if the transaction manager encountersan unexpected error condition



connectionClosed
public void connectionClosed(ResourceManagerEvent event)(Code)

See Also:   org.objectweb.transaction.jta.ResourceManagerEventListener.connectionClosed(org.objectweb.transaction.jta.ResourceManagerEvent)



connectionErrorOccured
public void connectionErrorOccured(ResourceManagerEvent event)(Code)

See Also:   org.objectweb.transaction.jta.ResourceManagerEventListener.connectionErrorOccured(org.objectweb.transaction.jta.ResourceManagerEvent)



connectionOpened
public void connectionOpened(ResourceManagerEvent event)(Code)

See Also:   org.objectweb.transaction.jta.ResourceManagerEventListener.connectionOpened(org.objectweb.transaction.jta.ResourceManagerEvent)



forget
void forget() throws Exception(Code)
remove the Transaction from the ThreadLocal



forgetTx
public void forgetTx(Xid xid)(Code)
Forget all about this transaction. References to TransactionImpl must be destroyed to allow the garbage collector to free memory allocated to this transaction.
Parameters:
  xid - Xid of the transaction



getAllRcTx
public String[] getAllRcTx()(Code)
Get all Transactions that may require recovery. array of all Transactions that may require recovery



getAllTx
public String[] getAllTx()(Code)
Get all executing transactions. array of all Transactions in execution



getAllXaTx
public String[] getAllXaTx(String stx)(Code)
Get all XAResources that may require recovery. array of all XAResources that may require recovery



getAllXid
public javax.transaction.xa.Xid[] getAllXid()(Code)
Get all Xid's associated with this transaction. array of all Xids



getCurrent
public static Current getCurrent()(Code)
Returns the unique instance of the class or null if not initialized in case of plain client. The Current object created



getDefaultRecovery
public static boolean getDefaultRecovery()(Code)
Gets the default recovery value default recovery value (true or false)



getDefaultTimeout
public int getDefaultTimeout()(Code)
Gets the default timeout value default timeout value (in seconds)



getJTM
public static TransactionFactory getJTM()(Code)
Returns the TMFactory (in JTM) TransactionFactory



getPreparedHeuristicXid
public javax.transaction.xa.Xid[] getPreparedHeuristicXid()(Code)
Get the Xid's of all prepared transactions. array of all Xids in the prepared state



getPropagationContext
public TransactionContext getPropagationContext(boolean hold)(Code)
Get the transaction context associated with the current thread or null if the thread is not involved in a transaction.



getReference
public Reference getReference() throws NamingException(Code)
Retrieves the Reference of this object. The non-null Reference of this object.
exception:
  NamingException - If a naming exception was encountered while retrieving the reference.



getStatus
public int getStatus() throws SystemException(Code)
Returns the status of the transaction associated with the current thread. transaction status. If no transaction is associated with thecurrent thread, this method returns the Status.NoTransaction value.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



getTotalBegunTransactions
public int getTotalBegunTransactions()(Code)
Returns the total number of begun transactions. total number of begun transactions



getTotalCommittedTransactions
public int getTotalCommittedTransactions()(Code)
Returns the total number of committed transactions. total number of commited transactions



getTotalCurrentTransactions
public int getTotalCurrentTransactions()(Code)
Returns the current number of transactions. current number of transaction



getTotalExpiredTransactions
public int getTotalExpiredTransactions()(Code)
Returns the total number of rolled back transactions due to timeout. number of rolled back transactions due to timeout



getTotalRolledbackTransactions
public int getTotalRolledbackTransactions()(Code)
Returns the total number of rolled back transactions. total number of rolled back transactions



getTransaction
public Transaction getTransaction() throws SystemException(Code)
Gets the transaction object that represents the transaction context of the calling thread. the Transaction object representing the transaction associated with the calling thread. If the calling thread isnot associated with a transaction, a null object referenceis returned.
exception:
  SystemException - Thrown if the transaction manager encounters an unexpected error condition



getTransactionCounters
public synchronized Integer[] getTransactionCounters()(Code)
Returns all counters. an array of all counters (current tx, begun tx, committed tx,rolled back tx, timeouted tx)



getTransactionManager
public static TransactionManager getTransactionManager()(Code)
Gets the TransactionManager instance. TransactionManager



getTransactionRecovery
public static TransactionRecovery getTransactionRecovery()(Code)
Returns the Transaction Recovery object TransactionRecovery



getTxByXid
public TransactionImpl getTxByXid(Xid xid)(Code)
Get the transaction referenced by Xid.
Parameters:
  xid - Xid of the transaction



getXATerminator
public XATerminator getXATerminator() throws XAException(Code)
Gets the inflow transaction object that represents the transaction context of the calling thread. the XATerminator object representing the inflow transaction associated with the calling thread. If the calling thread isnot associated with an inflow transaction, a null object referenceis returned.
exception:
  XAException - Thrown if the transaction manager encounters an unexpected error condition



incrementBeginCounter
synchronized void incrementBeginCounter()(Code)
Increments number of begun transactions by one.



incrementCommitCounter
synchronized void incrementCommitCounter()(Code)
Increments the number of of committed transactions by one.



incrementExpiredCounter
synchronized void incrementExpiredCounter()(Code)
Increments number of rolled back transactions due to timeout by one.



incrementRollbackCounter
synchronized void incrementRollbackCounter()(Code)
Increments the number of rolled back transaction by one.



popThreadLocalRMEventList
public List popThreadLocalRMEventList()(Code)

See Also:   org.objectweb.transaction.jta.TransactionManager.popThreadLocalRMEventList



pushThreadLocalRMEventList
public void pushThreadLocalRMEventList(List eventList)(Code)

See Also:   org.objectweb.transaction.jta.TransactionManager.pushThreadLocalRMEventList(java.util.List)



resetAllTxTotalCounters
public synchronized void resetAllTxTotalCounters()(Code)
Resets total number of transactions.



resume
public void resume(Transaction tobj) throws InvalidTransactionException, IllegalStateException, SystemException(Code)
Resumes the transaction context association of the calling thread with the transaction represented by the supplied Transaction object. When this method returns, the calling thread is associated with the transaction context specified.

Warning: No XA start is done here. We suppose it is already done after a getConnection().

The supposed programming model is:
  1. getConnection()
  2. SQL code
  3. connection.close()

Parameters:
  tobj - The Transaction object that represents thetransaction to be resumed.
exception:
  InvalidTransactionException - Thrown if the parametertransaction object contains an invalid transaction
exception:
  IllegalStateException - Thrown if the thread is alreadyassociated with another transaction.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



rollback
public void rollback() throws IllegalStateException, SecurityException, SystemException(Code)
Rolls back the transaction associated with the current thread. When this method completes, the thread becomes associated with no transaction.
exception:
  SecurityException - Thrown to indicate that the thread is notallowed to roll back the transaction.
exception:
  IllegalStateException - Thrown if the current thread is notassociated with a transaction.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



setDefaultRecovery
public static void setDefaultRecovery(boolean recovery)(Code)
Sets the default recovery value
Parameters:
  recovery - recovery value (true or false)



setDefaultTimeout
public void setDefaultTimeout(int timeout)(Code)
Sets the default timeout value
Parameters:
  timeout - timeout value (in seconds)



setPropagationContext
public void setPropagationContext(TransactionContext pctx, boolean isReply)(Code)
Associate to the current thread a transaction represented by its transaction context. This is used internally by the implicit propagation of the transactional context:
  • in the skeleton, before calling the request (isReply = false)
  • in the stub, after receiving the reply (isReply = true)

Parameters:
  pctx - TransactionContext
Parameters:
  isReply - true before calling a request,false after receiving a reply



setRollbackOnly
public void setRollbackOnly() throws IllegalStateException, SystemException(Code)
Modify the transaction associated with the current thread such that the only possible outcome of the transaction is to roll back the transaction.
exception:
  IllegalStateException - Thrown if the current thread is notassociated with a transaction.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



setTransactionRecovery
public void setTransactionRecovery(boolean recovery) throws SystemException(Code)
Modifies the value of the recovery value that is associated with the transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses the default value of 'false' for recovery.
Parameters:
  recovery - value of the recovery (true or faluse). If the value isfalse, recovery of transactions is disabled.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



setTransactionTimeout
public void setTransactionTimeout(int timeout) throws SystemException(Code)
Modifies the value of the timeout value that is associated with the transactions started by the current thread with the begin method. If an application has not called this method, the transaction service uses some default value for the transaction timeout.
Parameters:
  timeout - value of the timeout (in seconds). If the value is zero,the transaction service restores the default value.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



suspend
public Transaction suspend() throws SystemException(Code)
Suspends the transaction currently associated with the calling thread and return a Transaction object that represents the transaction context being suspended. If the calling thread is not associated with a transaction, the method returns null. When this method returns, the calling thread is associated with no transaction.

Warning: No XA start is done here. We suppose it is already done after a getConnection().

The supposed programming model is:
  1. getConnection()
  2. SQL code
  3. connection.close()
Transaction object representing the suspended transaction.
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition
exception:
  SystemException - Thrown if the transaction managerencounters an unexpected error condition



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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