Java Doc for StandardPoolDataSource.java in  » Database-JDBC-Connection-Pool » xapool » org » enhydra » jdbc » pool » 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 » xapool » org.enhydra.jdbc.pool 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.enhydra.jdbc.core.CoreDataSource
   org.enhydra.jdbc.pool.StandardPoolDataSource

All known Subclasses:   org.enhydra.jdbc.pool.StandardXAPoolDataSource,
StandardPoolDataSource
public class StandardPoolDataSource extends CoreDataSource implements DataSource,PoolHelper,ConnectionEventListener(Code)
StandardPoolDataSource class allows to make some operations on PooledConnection. It implements PoolHelper for the 3 methods :

create : create a PooledConnection

create(user,password) : create a PooledConnection with an other user/password

testThisObject : check if the object is still valid

checkThisObject : check if the object is closed

expire : kill the object



Field Summary
public  ConnectionPoolDataSourcecpds
    
public  StringdataSourceName
    
public  Logglog
    
public  Contextictx
    
public  StringjdbcTestStmt
    
public  booleanonOff
    
public  GenericPoolpool
    

Constructor Summary
public  StandardPoolDataSource()
    
public  StandardPoolDataSource(int initSize)
    
public  StandardPoolDataSource(ConnectionPoolDataSource cc)
    
public  StandardPoolDataSource(ConnectionPoolDataSource cc, int initSize)
    

Method Summary
public  booleancheckThisObject(Object o)
    
public  voidconnectionClosed(ConnectionEvent event)
    
public  voidconnectionErrorOccurred(ConnectionEvent event)
    
public  GenerationObjectcreate()
    
public  GenerationObjectcreate(String _user, String _password)
    
public  voidexpire(Object o)
    
public  voidfullRemoveLockedObject(GenerationObject obj)
    
public  intgetCheckLevelObject()
    
public  ConnectiongetConnection()
     getConnection allows to get an object from the pool and returns it to the user.
public  ConnectiongetConnection(String _user, String _password)
     getConnection allows to get an object from the pool and returns it to the user.
public  StringgetDataSourceName()
    
public  longgetDeadLockMaxWait()
    
public  longgetDeadLockRetryWait()
    
public  intgetGeneration()
    
public  StringgetJdbcTestStmt()
    
public  longgetLifeTime()
    
public  intgetLockedObjectCount()
    
public  PrintWritergetLogWriter()
    
public  longgetMaxLifeTime()
    
public  intgetMaxSize()
    
public  intgetMinSize()
    
public  ObjectgetObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env)
    
public  GenericPoolgetPool()
    
public  ReferencegetReference()
     Retrieves the Reference of this object.
public  longgetSleepTime()
    
public  intgetUnlockedObjectCount()
    
public  GenericPoolgetUsedPool()
    
public  booleanisGC()
    
public  voidremoveUnlockedObject(GenerationObject obj)
    
public  voidsetCheckLevelObject(int checkLevelObject)
    
public  voidsetDataSourceName(String dataSourceName)
    
public  voidsetDeadLockMaxWait(long deadLock)
    
public  voidsetDeadLockRetryWait(long loopWait)
    
public  voidsetDebug(boolean debug)
    
public  voidsetGC(boolean gc)
    
public  voidsetGeneration(int generation)
    
public  voidsetJdbcTestStmt(String jdbcTestStmt)
    
public  voidsetLifeTime(long lifeTime)
    
public  voidsetLogWriter(PrintWriter logWriter)
    
public  voidsetMaxLifeTime(long maxLifeTime)
    
public  voidsetMaxSize(int maxSize)
    
public  voidsetMinSize(int minSize)
    
public  voidsetSleepTime(long sleepTime)
    
public  voidsetThreadFactory(JdbcThreadFactory tf)
    
public  voidshutdown(boolean force)
    
public  voidstopPool()
    
public  booleantestThisObject(Object o)
    
public  StringtoString()
    

Field Detail
cpds
public ConnectionPoolDataSource cpds(Code)



dataSourceName
public String dataSourceName(Code)



glog
public Log glog(Code)



ictx
public Context ictx(Code)



jdbcTestStmt
public String jdbcTestStmt(Code)



onOff
public boolean onOff(Code)



pool
public GenericPool pool(Code)




Constructor Detail
StandardPoolDataSource
public StandardPoolDataSource()(Code)
Constructor



StandardPoolDataSource
public StandardPoolDataSource(int initSize)(Code)
Constructor



StandardPoolDataSource
public StandardPoolDataSource(ConnectionPoolDataSource cc)(Code)
Constructor



StandardPoolDataSource
public StandardPoolDataSource(ConnectionPoolDataSource cc, int initSize)(Code)
Constructor




Method Detail
checkThisObject
public boolean checkThisObject(Object o)(Code)
This method tests if a connection is closed or not



connectionClosed
public void connectionClosed(ConnectionEvent event)(Code)
Invoked when the application calls close() on its representation of the connection



connectionErrorOccurred
public void connectionErrorOccurred(ConnectionEvent event)(Code)
connectionErrorOccurred and connectionClosed are methods from ConnectionEventListener interface Invoked when a fatal connection error occurs, just before an SQLException is thrown to the application



create
public GenerationObject create() throws SQLException(Code)



create
public GenerationObject create(String _user, String _password) throws SQLException(Code)



expire
public void expire(Object o)(Code)
object specific work to kill the object



fullRemoveLockedObject
public void fullRemoveLockedObject(GenerationObject obj)(Code)



getCheckLevelObject
public int getCheckLevelObject()(Code)



getConnection
public Connection getConnection() throws SQLException(Code)
getConnection allows to get an object from the pool and returns it to the user. In this case, we return an PooledConnection



getConnection
public Connection getConnection(String _user, String _password) throws SQLException(Code)
getConnection allows to get an object from the pool and returns it to the user. In this case, we return an PooledConnection



getDataSourceName
public String getDataSourceName()(Code)



getDeadLockMaxWait
public long getDeadLockMaxWait()(Code)



getDeadLockRetryWait
public long getDeadLockRetryWait()(Code)



getGeneration
public int getGeneration()(Code)



getJdbcTestStmt
public String getJdbcTestStmt()(Code)



getLifeTime
public long getLifeTime()(Code)



getLockedObjectCount
public int getLockedObjectCount()(Code)



getLogWriter
public PrintWriter getLogWriter()(Code)



getMaxLifeTime
public long getMaxLifeTime()(Code)



getMaxSize
public int getMaxSize()(Code)



getMinSize
public int getMinSize()(Code)



getObjectInstance
public Object getObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env) throws Exception(Code)



getPool
public GenericPool getPool()(Code)



getReference
public Reference getReference() throws NamingException(Code)
Retrieves the Reference of this object. Used at binding time by JNDI to build a reference on this object. The non-null Reference of this object.
exception:
  NamingException - If a naming exception was encountered whileretrieving the reference.



getSleepTime
public long getSleepTime()(Code)



getUnlockedObjectCount
public int getUnlockedObjectCount()(Code)



getUsedPool
public GenericPool getUsedPool()(Code)



isGC
public boolean isGC()(Code)



removeUnlockedObject
public void removeUnlockedObject(GenerationObject obj)(Code)



setCheckLevelObject
public void setCheckLevelObject(int checkLevelObject)(Code)
set the check level of the pooled object before using them
Parameters:
  checkLevelObject - (
0 = no special checking1 = just a check on an object2 = test the object3 = just a check on an object (for all the objects)4 = test the object (for all the objects)



setDataSourceName
public void setDataSourceName(String dataSourceName)(Code)
Set up the data source name, get the initial context, and lookup in JNDI to obtain a reference of the DataSourceName this method must be called before a getConnection (in this case an exception is returned



setDeadLockMaxWait
public void setDeadLockMaxWait(long deadLock)(Code)
set the global time the pool can wait for a free object
Parameters:
  deadLock - in milliseconds



setDeadLockRetryWait
public void setDeadLockRetryWait(long loopWait)(Code)
set the time before 2 tries when trying to obtain an object from the pool
Parameters:
  loopWait - in milliseconds



setDebug
public void setDebug(boolean debug)(Code)
set the debug flag
Parameters:
  debug - a boolean flag



setGC
public void setGC(boolean gc)(Code)
set the garbage collection option
Parameters:
  gc - true: the garbage collector will be launched when clean up of thepool, else false



setGeneration
public void setGeneration(int generation)(Code)
set the generation number for future connection, the generation number is used to identify a group a created objects
Parameters:
  generation - an integer value which represents a generation



setJdbcTestStmt
public void setJdbcTestStmt(String jdbcTestStmt)(Code)
set the String to test the jdbc connection before using it
Parameters:
  jdbcTestStmt - an sql statement



setLifeTime
public void setLifeTime(long lifeTime)(Code)
set the life time of the pooled objects
Parameters:
  lifeTime - life time of the pooled objects (in milliseconds)



setLogWriter
public void setLogWriter(PrintWriter logWriter)(Code)
set the logwriter for the current object, the logwriter will be use by the current object and by the generic pool
Parameters:
  logWriter - a PrintWriter object



setMaxLifeTime
public void setMaxLifeTime(long maxLifeTime)(Code)



setMaxSize
public void setMaxSize(int maxSize) throws Exception(Code)
set the maximum size of the pool
Parameters:
  maxSize - maximum size of the pool
throws:
  Exception -



setMinSize
public void setMinSize(int minSize) throws Exception(Code)
set the minimum size of the pool
Parameters:
  minSize - minimum size of the pool
throws:
  Exception -



setSleepTime
public void setSleepTime(long sleepTime)(Code)
set the sleep time of pooled objects
Parameters:
  sleepTime - sleep time of the pooled objects (in milliseconds)



setThreadFactory
public void setThreadFactory(JdbcThreadFactory tf)(Code)
Override this so that the pool's tf gets set as well



shutdown
public void shutdown(boolean force)(Code)



stopPool
public void stopPool()(Code)
stop method to switch off the pool



testThisObject
public boolean testThisObject(Object o)(Code)
This method tests if a connection is valid or not



toString
public String toString()(Code)



Fields inherited from org.enhydra.jdbc.core.CoreDataSource
public transient PrintWriter logWriter(Code)(Java Doc)
public String password(Code)(Java Doc)
public String user(Code)(Java Doc)

Methods inherited from org.enhydra.jdbc.core.CoreDataSource
public String getDescription()(Code)(Java Doc)
public PrintWriter getLogWriter()(Code)(Java Doc)
public int getLoginTimeout()(Code)(Java Doc)
public Object getObjectInstance(Object refObj, Name name, Context nameCtx, Hashtable env) throws Exception(Code)(Java Doc)
public String getPassword()(Code)(Java Doc)
public Reference getReference() throws NamingException(Code)(Java Doc)
public JdbcThreadFactory getThreadFactory()(Code)(Java Doc)
public String getUser()(Code)(Java Doc)
public boolean isDebug()(Code)(Java Doc)
public boolean isVerbose()(Code)(Java Doc)
public void setDebug(boolean debug)(Code)(Java Doc)
public void setDescription(String description)(Code)(Java Doc)
public void setLogWriter(PrintWriter out)(Code)(Java Doc)
public void setLoginTimeout(int seconds)(Code)(Java Doc)
public void setPassword(String password)(Code)(Java Doc)
public void setThreadFactory(JdbcThreadFactory f)(Code)(Java Doc)
public void setUser(String user)(Code)(Java Doc)
public void setVerbose(boolean verbose)(Code)(Java Doc)
public void shutdown(boolean force)(Code)(Java Doc)
public String toString()(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.