Java Doc for KeyedCPDSConnectionFactory.java in  » Database-JDBC-Connection-Pool » Connection-Pool-DBCP » org » apache » commons » dbcp » datasources » 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 » Connection Pool DBCP » org.apache.commons.dbcp.datasources 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.commons.dbcp.datasources.KeyedCPDSConnectionFactory

KeyedCPDSConnectionFactory
class KeyedCPDSConnectionFactory implements KeyedPoolableObjectFactory,ConnectionEventListener(Code)
A {*link PoolableObjectFactory} that creates {*link PoolableConnection}s.
author:
   John D. McNally
version:
   $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $


Field Summary
protected  ConnectionPoolDataSource_cpds
    
protected  KeyedObjectPool_pool
    
protected  boolean_rollbackAfterValidation
    
protected  String_validationQuery
    

Constructor Summary
public  KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery)
     Create a new KeyedPoolableConnectionFactory.
Parameters:
  cpds - the ConnectionPoolDataSource from which to obtain PooledConnection's
Parameters:
  pool - the {*link ObjectPool} in which to pool those {*link Connection}s
Parameters:
  validationQuery - a query to use to {*link #validateObject validate} {*link Connection}s.
public  KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery, boolean rollbackAfterValidation)
     Create a new KeyedPoolableConnectionFactory.
Parameters:
  cpds - the ConnectionPoolDataSource from which to obtainPooledConnections
Parameters:
  pool - the ObjectPool in which to pool thoseConnections
Parameters:
  validationQuery - a query to use to KeyedCPDSConnectionFactory.validateObject validateConnections.

Method Summary
public  voidactivateObject(Object key, Object obj)
    
public  voidconnectionClosed(ConnectionEvent event)
     This will be called if the Connection returned by the getConnection method came from a PooledConnection, and the user calls the close() method of this connection object.
public  voidconnectionErrorOccurred(ConnectionEvent event)
    
public  voiddestroyObject(Object key, Object obj)
    
public  KeyedObjectPoolgetPool()
    
public synchronized  ObjectmakeObject(Object key)
    
public  voidpassivateObject(Object key, Object obj)
    
public synchronized  voidsetCPDS(ConnectionPoolDataSource cpds)
     Sets the ConnectionFactory from which to obtain base Connection s.
public synchronized  voidsetPool(KeyedObjectPool pool)
     Sets the {*link ObjectPool} in which to pool {*link Connection}s.
public synchronized  voidsetRollbackAfterValidation(boolean rollbackAfterValidation)
     Sets whether a rollback should be issued after {*link #validateObject validating} {*link Connection}s.
public synchronized  voidsetValidationQuery(String validationQuery)
     Sets the query I use to {*link #validateObject validate} {*link Connection}s.
public  booleanvalidateObject(Object key, Object obj)
    

Field Detail
_cpds
protected ConnectionPoolDataSource _cpds(Code)



_pool
protected KeyedObjectPool _pool(Code)



_rollbackAfterValidation
protected boolean _rollbackAfterValidation(Code)



_validationQuery
protected String _validationQuery(Code)




Constructor Detail
KeyedCPDSConnectionFactory
public KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery)(Code)
Create a new KeyedPoolableConnectionFactory.
Parameters:
  cpds - the ConnectionPoolDataSource from which to obtain PooledConnection's
Parameters:
  pool - the {*link ObjectPool} in which to pool those {*link Connection}s
Parameters:
  validationQuery - a query to use to {*link #validateObject validate} {*link Connection}s. Should return at least one row. May be null



KeyedCPDSConnectionFactory
public KeyedCPDSConnectionFactory(ConnectionPoolDataSource cpds, KeyedObjectPool pool, String validationQuery, boolean rollbackAfterValidation)(Code)
Create a new KeyedPoolableConnectionFactory.
Parameters:
  cpds - the ConnectionPoolDataSource from which to obtainPooledConnections
Parameters:
  pool - the ObjectPool in which to pool thoseConnections
Parameters:
  validationQuery - a query to use to KeyedCPDSConnectionFactory.validateObject validateConnections. Should return at least one row. May be null
Parameters:
  rollbackAfterValidation - whether a rollback should be issued afterKeyedCPDSConnectionFactory.validateObject validating Connections.




Method Detail
activateObject
public void activateObject(Object key, Object obj)(Code)



connectionClosed
public void connectionClosed(ConnectionEvent event)(Code)
This will be called if the Connection returned by the getConnection method came from a PooledConnection, and the user calls the close() method of this connection object. What we need to do here is to release this PooledConnection from our pool...



connectionErrorOccurred
public void connectionErrorOccurred(ConnectionEvent event)(Code)
If a fatal error occurs, close the underlying physical connection so as not to be returned in the future



destroyObject
public void destroyObject(Object key, Object obj) throws Exception(Code)



getPool
public KeyedObjectPool getPool()(Code)



makeObject
public synchronized Object makeObject(Object key) throws Exception(Code)

Parameters:
  key -
throws:
  SQLException - if the connection could not be created.
See Also:   org.apache.commons.pool.KeyedPoolableObjectFactory.makeObject(java.lang.Object)



passivateObject
public void passivateObject(Object key, Object obj)(Code)



setCPDS
public synchronized void setCPDS(ConnectionPoolDataSource cpds)(Code)
Sets the ConnectionFactory from which to obtain base Connection s.
Parameters:
  connFactory - the {*link ConnectionFactory} from which to obtain base Connections



setPool
public synchronized void setPool(KeyedObjectPool pool) throws SQLException(Code)
Sets the {*link ObjectPool} in which to pool {*link Connection}s.
Parameters:
  pool - the {*link ObjectPool} in which to pool those {*link Connection}s



setRollbackAfterValidation
public synchronized void setRollbackAfterValidation(boolean rollbackAfterValidation)(Code)
Sets whether a rollback should be issued after {*link #validateObject validating} {*link Connection}s.
Parameters:
  rollbackAfterValidation - whether a rollback should be issued after{*link #validateObject validating} {*link Connection}s.



setValidationQuery
public synchronized void setValidationQuery(String validationQuery)(Code)
Sets the query I use to {*link #validateObject validate} {*link Connection}s. Should return at least one row. May be null
Parameters:
  validationQuery - a query to use to {*link #validateObject validate} {*link Connection}s.



validateObject
public boolean validateObject(Object key, Object obj)(Code)



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.