Java Doc for XAConnectionFactory.java in  » ERP-CRM-Financial » SourceTap-CRM » org » ofbiz » minerva » pool » jdbc » 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 » ERP CRM Financial » SourceTap CRM » org.ofbiz.minerva.pool.jdbc.xa 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ofbiz.minerva.pool.PoolObjectFactory
      org.ofbiz.minerva.pool.jdbc.xa.XAConnectionFactory

XAConnectionFactory
public class XAConnectionFactory extends PoolObjectFactory (Code)
Object factory for JDBC 2.0 standard extension XAConnections. You pool the XAConnections instead of the java.sql.Connections since with vendor conformant drivers, you don't have direct access to the java.sql.Connection, and any work done isn't associated with the java.sql.Connection anyway.

Note: This implementation requires that the TransactionManager be bound to a JNDI name.

Note: This implementation has special handling for Minerva JDBC 1/2 XA Wrappers. Namely, when a request comes in, if it is for a wrapper connection and it has the same current transaction as a previous active connection, the same previous connection will be returned. Otherwise, you won't be able to share changes across connections like you can with the native JDBC 2 Standard Extension implementations.


author:
   Aaron Mulder (ammulder@alumni.princeton.edu)
author:
   Bill Burke
author:
   REVISIONS:
author:
   20010703 bill added code for transaction isolation
version:
   $Revision: 1.2 $


Field Summary
final public static  intDEFAULT_ISOLATION
    

Constructor Summary
public  XAConnectionFactory()
     Creates a new factory.

Method Summary
public  booleancheckValidObject(Object source, Object parameters)
     For XAConnectionImpl check that parameters = String[2]{username, password} and that these match the the source connection user and password.
public  ObjectcreateObject(Object parameters)
     Creates a new XAConnection from the provided XADataSource.
public  voiddeleteObject(Object pooledObject)
     Closes a connection.
public  XADataSourcegetDataSource()
     Gets the XADataSource used to generate XAConnections.
public  intgetPSCacheSize()
     Gets the number of PreparedStatements to be cached for each Connection.
public  StringgetPassword()
     Gets the password used to generate XAConnections.
public  booleangetReleaseOnCommit()
    
public  booleangetSaveStackTrace()
     Have XAClientConnections save a stack trace on creation This is useful for debugging non-closed connections.
public  intgetTransactionIsolation()
     Gets the transaction isolation level of connections.
public  TransactionManagergetTransactionManager()
     Gets the TransactionManager.
public  StringgetUser()
     Gets the user name used to generate XAConnections.
public  ObjectisUniqueRequest()
     If a new object is requested and it is a JDBC 1/2 wrapper connection in the same Transaction as an existing connection, return that same connection.
public  voidpoolStarted(ObjectPool pool)
     Verifies that the data source and transaction manager are accessible.
public  ObjectprepareObject(Object pooledObject)
     Registers the XAConnection's XAResource with the current transaction (if there is one).
public  voidsetDataSource(XADataSource dataSource)
     Sets the XADataSource used to generate XAConnections.
public  voidsetPSCacheSize(int size)
     Sets the number of PreparedStatements to be cached for each Connection.
public  voidsetPassword(String password)
     Sets the password used to generate XAConnections.
public  voidsetReleaseOnCommit(boolean rel)
    
public  voidsetSaveStackTrace(boolean save)
    
public  voidsetTransactionIsolation(int iso)
    
public  voidsetTransactionIsolation(String iso)
    
public  voidsetTransactionManager(TransactionManager tm)
     Sets the TransactionManager.
public  voidsetUser(String userName)
     Sets the user name used to generate XAConnections.

Field Detail
DEFAULT_ISOLATION
final public static int DEFAULT_ISOLATION(Code)




Constructor Detail
XAConnectionFactory
public XAConnectionFactory() throws NamingException(Code)
Creates a new factory. You must set the XADataSource and TransactionManager JNDI name before the factory can be used.




Method Detail
checkValidObject
public boolean checkValidObject(Object source, Object parameters)(Code)
For XAConnectionImpl check that parameters = String[2]{username, password} and that these match the the source connection user and password. Return true for non-XAConnectionImpl sources



createObject
public Object createObject(Object parameters) throws Exception(Code)
Creates a new XAConnection from the provided XADataSource.



deleteObject
public void deleteObject(Object pooledObject)(Code)
Closes a connection.



getDataSource
public XADataSource getDataSource()(Code)
Gets the XADataSource used to generate XAConnections.



getPSCacheSize
public int getPSCacheSize()(Code)
Gets the number of PreparedStatements to be cached for each Connection. The default value is 10.



getPassword
public String getPassword()(Code)
Gets the password used to generate XAConnections.



getReleaseOnCommit
public boolean getReleaseOnCommit()(Code)



getSaveStackTrace
public boolean getSaveStackTrace()(Code)
Have XAClientConnections save a stack trace on creation This is useful for debugging non-closed connections. It must be used with ReleaseOnCommit option



getTransactionIsolation
public int getTransactionIsolation()(Code)
Gets the transaction isolation level of connections. This defaults to whatever the connection's default iso level is.



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



getUser
public String getUser()(Code)
Gets the user name used to generate XAConnections.



isUniqueRequest
public Object isUniqueRequest()(Code)
If a new object is requested and it is a JDBC 1/2 wrapper connection in the same Transaction as an existing connection, return that same connection.



poolStarted
public void poolStarted(ObjectPool pool)(Code)
Verifies that the data source and transaction manager are accessible.



prepareObject
public Object prepareObject(Object pooledObject)(Code)
Registers the XAConnection's XAResource with the current transaction (if there is one). Sets listeners that will handle deregistering and returning the XAConnection to the pool via callbacks.



setDataSource
public void setDataSource(XADataSource dataSource)(Code)
Sets the XADataSource used to generate XAConnections. This may be supplied by the vendor, or it may use the wrappers for non-compliant drivers (see XADataSourceImpl).
See Also:   org.ofbiz.minerva.pool.jdbc.xa.wrapper.XADataSourceImpl



setPSCacheSize
public void setPSCacheSize(int size)(Code)
Sets the number of PreparedStatements to be cached for each Connection. Your DB product may impose a limit on the number of open PreparedStatements. The default value is 10.



setPassword
public void setPassword(String password)(Code)
Sets the password used to generate XAConnections. This is optional, and will only be used if present.



setReleaseOnCommit
public void setReleaseOnCommit(boolean rel)(Code)



setSaveStackTrace
public void setSaveStackTrace(boolean save)(Code)



setTransactionIsolation
public void setTransactionIsolation(int iso)(Code)



setTransactionIsolation
public void setTransactionIsolation(String iso)(Code)



setTransactionManager
public void setTransactionManager(TransactionManager tm)(Code)
Sets the TransactionManager.



setUser
public void setUser(String userName)(Code)
Sets the user name used to generate XAConnections. This is optional, and will only be used if present.



Methods inherited from org.ofbiz.minerva.pool.PoolObjectFactory
public boolean checkValidObject(Object source, Object parameters)(Code)(Java Doc)
abstract public Object createObject(Object parameters) throws Exception(Code)(Java Doc)
public void deleteObject(Object pooledObject)(Code)(Java Doc)
public Object isUniqueRequest()(Code)(Java Doc)
public void poolClosing(ObjectPool pool)(Code)(Java Doc)
public void poolStarted(ObjectPool pool)(Code)(Java Doc)
public Object prepareObject(Object pooledObject)(Code)(Java Doc)
public Object returnObject(Object clientObject)(Code)(Java Doc)
public Object translateObject(Object clientObject)(Code)(Java Doc)

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.