Java Doc for JManagedConnection.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » component » jdbcpool » 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 » J2EE » ow2 easybeans » org.ow2.easybeans.component.jdbcpool 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ow2.easybeans.component.jdbcpool.JManagedConnection

JManagedConnection
public class JManagedConnection implements Comparable,XAConnection,XAResource,Synchronization(Code)
This class represents the connection managed by the pool. This connection is a managed connection and is notified of the transaction events.
author:
   Philippe Durieux
author:
   Florent Benoit



Constructor Summary
public  JManagedConnection(Connection physicalConnection, ConnectionManager ds)
     Builds a new managed connection on a JDBC connection.

Method Summary
public  voidaddConnectionEventListener(ConnectionEventListener listener)
     Add an event listener.
public  voidafterCompletion(int status)
     synchronization implementation.
public  voidbeforeCompletion()
     synchronization implementation.
public  voidclose()
     Close the database connection.
public  voidcommit(Xid xid, boolean onePhase)
     Commit the global transaction specified by xid.
public  intcompareTo(Object o)
     Compares this object with another specified object.
public  voidend(Xid xid, int flags)
     Ends the work performed on behalf of a transaction branch.
public  voidforget(Xid xid)
     Tell the resource manager to forget about a heuristically completed transaction branch.
public  ConnectiongetConnection()
     Create an object handle for a database connection.
public  intgetIdentifier()
    
public  intgetOpenCount()
    
public  intgetReUsedPreparedStatements()
    
public  intgetTransactionTimeout()
     Obtain the current transaction timeout value set for this XAResource instance.
public  TransactiongetTx()
    
public  XAResourcegetXAResource()
     Return an XA resource to the caller.
public  voidhold()
     Notify as opened.
public  booleaninactive()
     Check if the connection has been unused for too long time.
public  booleanisAged()
    
public  booleanisClosed()
    
public  booleanisOpen()
    
public  booleanisSameRM(XAResource xares)
     Determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares.
public  voidnotifyClose()
     Notify a Close event on Connection.
public  voidnotifyError(SQLException ex)
     Notify an Error event on Connection.
public  voidnotifyPsClose(JStatement ps)
     A PreparedStatement has been logically closed.
public  intprepare(Xid xid)
     Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
public  PreparedStatementprepareStatement(String sql, int resultSetType, int resultSetConcurrency)
     Try to find a PreparedStatement in the pool for the given options.
public  PreparedStatementprepareStatement(String sql)
     Try to find a PreparedStatement in the pool.
Parameters:
  sql - the given sql query.
throws:
  SQLException - if an error in the database occurs.
public  Xid[]recover(int flag)
     Obtain a list of prepared transaction branches from a resource manager.
Parameters:
  flag - unused parameter.
public  booleanrelease()
     notify as closed.
public  voidremove()
     remove this item, ignoring exception on close.
public  voidremoveConnectionEventListener(ConnectionEventListener listener)
     Remove an event listener.
public  voidrollback(Xid xid)
     Inform the resource manager to roll back work done on behalf of a transaction branch.
public  voidsetPstmtMax(int max)
     Dynamically change the prepared statement pool size.
public  booleansetTransactionTimeout(int seconds)
     Set the current transaction timeout value for this XAResource instance.
Parameters:
  seconds - timeout value, in seconds.
public  voidsetTx(Transaction tx)
     Set the associated transaction.
public  voidstart(Xid xid, int flags)
     Start work on behalf of a transaction branch specified in xid.


Constructor Detail
JManagedConnection
public JManagedConnection(Connection physicalConnection, ConnectionManager ds)(Code)
Builds a new managed connection on a JDBC connection.
Parameters:
  physicalConnection - the physical JDBC Connection.
Parameters:
  ds - the connection manager




Method Detail
addConnectionEventListener
public void addConnectionEventListener(ConnectionEventListener listener)(Code)
Add an event listener.
Parameters:
  listener - event listener



afterCompletion
public void afterCompletion(int status)(Code)
synchronization implementation.



beforeCompletion
public void beforeCompletion()(Code)
synchronization implementation.



close
public void close() throws SQLException(Code)
Close the database connection.
exception:
  SQLException - - if a database-access error occurs



commit
public void commit(Xid xid, boolean onePhase) throws XAException(Code)
Commit the global transaction specified by xid.
Parameters:
  xid - transaction xid
Parameters:
  onePhase - true if one phase commit
throws:
  XAException - XA protocol error



compareTo
public int compareTo(Object o)(Code)
Compares this object with another specified object.
Parameters:
  o - the object to compare a value detecting if these objects are matching or not.



end
public void end(Xid xid, int flags) throws XAException(Code)
Ends the work performed on behalf of a transaction branch.
Parameters:
  xid - transaction xid
Parameters:
  flags - currently unused
throws:
  XAException - XA protocol error



forget
public void forget(Xid xid) throws XAException(Code)
Tell the resource manager to forget about a heuristically completed transaction branch.
Parameters:
  xid - transaction xid
throws:
  XAException - XA protocol error



getConnection
public Connection getConnection() throws SQLException(Code)
Create an object handle for a database connection.
exception:
  SQLException - - if a database-access error occurs connection used by this managed connection



getIdentifier
public int getIdentifier()(Code)
The identifier of this JManagedConnection



getOpenCount
public int getOpenCount()(Code)
open count



getReUsedPreparedStatements
public int getReUsedPreparedStatements()(Code)
value of reused prepared statement.



getTransactionTimeout
public int getTransactionTimeout() throws XAException(Code)
Obtain the current transaction timeout value set for this XAResource instance. the current transaction timeout in seconds
throws:
  XAException - XA protocol error



getTx
public Transaction getTx()(Code)
the Transaction



getXAResource
public XAResource getXAResource() throws SQLException(Code)
Return an XA resource to the caller. The XAResource
exception:
  SQLException - - if a database-access error occurs



hold
public void hold()(Code)
Notify as opened.



inactive
public boolean inactive()(Code)
Check if the connection has been unused for too long time. This occurs usually when the caller forgot to call close(). true if open time has been reached, and not involved in a tx.



isAged
public boolean isAged()(Code)
true if connection max age has expired



isClosed
public boolean isClosed()(Code)
true if connection is closed



isOpen
public boolean isOpen()(Code)
true if connection is still open



isSameRM
public boolean isSameRM(XAResource xares) throws XAException(Code)
Determine if the resource manager instance represented by the target object is the same as the resource manager instance represented by the parameter xares.
Parameters:
  xares - An XAResource object True if same RM instance, otherwise false.
throws:
  XAException - XA protocol error



notifyClose
public void notifyClose()(Code)
Notify a Close event on Connection.



notifyError
public void notifyError(SQLException ex)(Code)
Notify an Error event on Connection.
Parameters:
  ex - the given exception



notifyPsClose
public void notifyPsClose(JStatement ps)(Code)
A PreparedStatement has been logically closed.
Parameters:
  ps - a prepared statement.



prepare
public int prepare(Xid xid) throws XAException(Code)
Ask the resource manager to prepare for a transaction commit of the transaction specified in xid.
Parameters:
  xid - transaction xid
throws:
  XAException - XA protocol error always OK



prepareStatement
public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException(Code)
Try to find a PreparedStatement in the pool for the given options.
Parameters:
  sql - the sql of the prepared statement
Parameters:
  resultSetType - the type of resultset
Parameters:
  resultSetConcurrency - the concurrency of this resultset a preparestatement object
throws:
  SQLException - if an errors occurs on the database.



prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException(Code)
Try to find a PreparedStatement in the pool.
Parameters:
  sql - the given sql query.
throws:
  SQLException - if an error in the database occurs. a given prepared statement.



recover
public Xid[] recover(int flag) throws XAException(Code)
Obtain a list of prepared transaction branches from a resource manager.
Parameters:
  flag - unused parameter. an array of transaction Xids
throws:
  XAException - XA protocol error



release
public boolean release()(Code)
notify as closed. true if normal close.



remove
public void remove()(Code)
remove this item, ignoring exception on close.



removeConnectionEventListener
public void removeConnectionEventListener(ConnectionEventListener listener)(Code)
Remove an event listener.
Parameters:
  listener - event listener



rollback
public void rollback(Xid xid) throws XAException(Code)
Inform the resource manager to roll back work done on behalf of a transaction branch.
Parameters:
  xid - transaction xid
throws:
  XAException - XA protocol error



setPstmtMax
public void setPstmtMax(int max)(Code)
Dynamically change the prepared statement pool size.
Parameters:
  max - the maximum of prepared statement.



setTransactionTimeout
public boolean setTransactionTimeout(int seconds) throws XAException(Code)
Set the current transaction timeout value for this XAResource instance.
Parameters:
  seconds - timeout value, in seconds. always true
throws:
  XAException - XA protocol error



setTx
public void setTx(Transaction tx)(Code)
Set the associated transaction.
Parameters:
  tx - Transaction



start
public void start(Xid xid, int flags) throws XAException(Code)
Start work on behalf of a transaction branch specified in xid.
Parameters:
  xid - transaction xid
Parameters:
  flags - unused parameter
throws:
  XAException - XA protocol error



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.