Java Doc for ConnectionManager.java in  » J2EE » JOnAS-4.8.6 » org » objectweb » jonas » dbm » 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 » JOnAS 4.8.6 » org.objectweb.jonas.dbm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.objectweb.jonas.dbm.ConnectionManager

ConnectionManager
public class ConnectionManager implements DataSource,XADataSource,Referenceable,Pool,Serializable,ConnectionEventListener(Code)
DataSource implementation. Manage a pool of connections.
author:
   durieuxp

Inner Class :class PoolMonitor extends Thread


Constructor Summary
public  ConnectionManager()
    
public  ConnectionManager(boolean isClient)
    

Method Summary
public synchronized  voidadjust()
     Adjust the pool size, according to poolMax and poolMin values.
public  StringcheckConnection(String testStatement)
    
public synchronized  voidcloseAllConnection()
     Close all connections in the pool, when server is shut down.
public  voidconnectionClosed(ConnectionEvent event)
    
public  voidconnectionErrorOccurred(ConnectionEvent event)
    
public synchronized  voidfreeConnections(Transaction tx)
     The transaction has committed (or rolled back).
public  intgetBusyMaxRecent()
    
public  intgetBusyMinRecent()
    
public  intgetCheckLevel()
    
public  StringgetClassName()
    
public  ConnectiongetConnection()
    
public  ConnectiongetConnection(String username, String password)
     Attempts to establish a connection with the data source that this DataSource object represents.
public  intgetConnectionFailures()
    
public  intgetConnectionLeaks()
    
public static  ConnectionManagergetConnectionManager(String dsname)
    
public  intgetCurrentBusy()
    
public  intgetCurrentInTx()
    
public  intgetCurrentOpened()
    
public  intgetCurrentWaiters()
    
public  StringgetDSName()
    
public  StringgetDataSourceDescription()
    
public  StringgetDatasourceName()
    
public  PrintWritergetLogWriter()
    
public  intgetLoginTimeout()
    
public  StringgetMapperName()
    
public  intgetMaxAge()
    
public  longgetMaxAgeMilli()
    
public  intgetMaxOpenTime()
    
public  longgetMaxOpenTimeMilli()
    
public  intgetMaxWaitTime()
    
public  intgetMaxWaiters()
    
public  intgetOpenedCount()
    
public  StringgetPassword()
    
public  PoolgetPool()
    
public  intgetPoolMax()
    
public  intgetPoolMin()
    
public  intgetPstmtMax()
    
public  ReferencegetReference()
     Retrieves the Reference of this object.
public  intgetRejectedFull()
    
public  intgetRejectedOpen()
    
public  intgetRejectedOther()
    
public  intgetRejectedTimeout()
    
public  intgetSamplingPeriod()
    
public  intgetServedOpen()
    
public  StringgetTestStatement()
    
public  StringgetTransactionIsolation()
    
public  StringgetUrl()
    
public  StringgetUserName()
    
public  intgetWaiterCount()
    
public  intgetWaitersHigh()
    
public  intgetWaitersHighRecent()
    
public  longgetWaitingHigh()
    
public  longgetWaitingHighRecent()
    
public  longgetWaitingTime()
    
public  XAConnectiongetXAConnection()
    
public  XAConnectiongetXAConnection(String user, String passwd)
     Attempts to establish a physical database connection, using the given user name and password.
public  booleanisClientCase()
     This manager is in the client case or not ? boolean true if this is the client caseTODO : must be removed.
public synchronized  JManagedConnectionopenConnection(String user, Transaction tx)
    
public  voidpoolConfigure(String connchecklevel, String connmaxage, String maxopentime, String connteststmt, String pstmtmax, String minconpool, String maxconpool, String maxwaittime, String maxwaiters, String samplingperiod)
     Configure the Connection pool.
public  voidrecomputeBusy()
    
public synchronized  voidsampling()
    
public  voidsetCheckLevel(int level)
    
public  voidsetClassName(String s)
    
public  voidsetDSName(String s)
    
public  voidsetDataSourceDescription(String dsDesc)
    
public  voidsetDatasourceName(String s)
    
public  voidsetLogWriter(PrintWriter out)
    
public  voidsetLoginTimeout(int seconds)
    
public  voidsetMapperName(String mappername)
    
public  voidsetMaxAge(int mn)
    
public  voidsetMaxOpenTime(int mn)
    
public  voidsetMaxWaitTime(int sec)
    
public  voidsetMaxWaiters(int nb)
    
public  voidsetPassword(String s)
    
public synchronized  voidsetPoolMax(int max)
    
Parameters:
  max - max pool size.
public synchronized  voidsetPoolMin(int min)
    
public  voidsetPstmtMax(int nb)
    
public  voidsetSamplingPeriod(int sec)
    
public  voidsetTestStatement(String s)
    
public  voidsetTransactionIsolation(String level)
    
public  voidsetUrl(String s)
    
public  voidsetUserName(String s)
    


Constructor Detail
ConnectionManager
public ConnectionManager() throws Exception(Code)
Constructor for Factory



ConnectionManager
public ConnectionManager(boolean isClient) throws Exception(Code)
Always called with true




Method Detail
adjust
public synchronized void adjust()(Code)
Adjust the pool size, according to poolMax and poolMin values. Also remove old connections in the freeList.



checkConnection
public String checkConnection(String testStatement) throws SQLException(Code)
Check on a connection the test statement
Parameters:
  testStatement - the statement to use for test the test statement if the test succeeded, an error message otherwise
throws:
  SQLException - If an error occured when trying to test (not due to the test itself,but to other preliminary or post operation).



closeAllConnection
public synchronized void closeAllConnection()(Code)
Close all connections in the pool, when server is shut down.



connectionClosed
public void connectionClosed(ConnectionEvent event)(Code)



connectionErrorOccurred
public void connectionErrorOccurred(ConnectionEvent event)(Code)



freeConnections
public synchronized void freeConnections(Transaction tx)(Code)
The transaction has committed (or rolled back). We can return its connections to the pool of available connections.
Parameters:
  tx - the non null transaction



getBusyMaxRecent
public int getBusyMaxRecent()(Code)
maximum nb of busy connections in last sampling period



getBusyMinRecent
public int getBusyMinRecent()(Code)
minimum nb of busy connections in last sampling period



getCheckLevel
public int getCheckLevel()(Code)
connection checking level



getClassName
public String getClassName()(Code)



getConnection
public Connection getConnection() throws SQLException(Code)



getConnection
public Connection getConnection(String username, String password) throws SQLException(Code)
Attempts to establish a connection with the data source that this DataSource object represents. - comes from the javax.sql.DataSource interface
Parameters:
  username - - the database user on whose behalf the connection is being made
Parameters:
  password - - the user's password a connection to the data source
throws:
  SQLException - - if a database access error occurs



getConnectionFailures
public int getConnectionFailures()(Code)
int number of xa connection failures on open



getConnectionLeaks
public int getConnectionLeaks()(Code)
int number of connection leaks



getConnectionManager
public static ConnectionManager getConnectionManager(String dsname)(Code)
get the ConnectionManager matching the DataSource name



getCurrentBusy
public int getCurrentBusy()(Code)
int number of busy xa connection



getCurrentInTx
public int getCurrentInTx()(Code)
int number of xa connection reserved for tx



getCurrentOpened
public int getCurrentOpened()(Code)
int number of xa connection



getCurrentWaiters
public int getCurrentWaiters()(Code)
current number of connection waiters



getDSName
public String getDSName()(Code)
Jndi name of the datasource



getDataSourceDescription
public String getDataSourceDescription()(Code)
the desrciption of this datasource



getDatasourceName
public String getDatasourceName()(Code)



getLogWriter
public PrintWriter getLogWriter() throws SQLException(Code)



getLoginTimeout
public int getLoginTimeout() throws SQLException(Code)



getMapperName
public String getMapperName()(Code)



getMaxAge
public int getMaxAge()(Code)
max age for connections (in mm)



getMaxAgeMilli
public long getMaxAgeMilli()(Code)
max age for connections (in millisec)



getMaxOpenTime
public int getMaxOpenTime()(Code)
max age for connections (in mns)



getMaxOpenTimeMilli
public long getMaxOpenTimeMilli()(Code)
max age for connections (in millisecs)



getMaxWaitTime
public int getMaxWaitTime()(Code)
waiter timeout in seconds



getMaxWaiters
public int getMaxWaiters()(Code)
max nb of waiters



getOpenedCount
public int getOpenedCount()(Code)
int number of physical jdbc connection opened



getPassword
public String getPassword()(Code)



getPool
public Pool getPool()(Code)
The pool associated to this datasource



getPoolMax
public int getPoolMax()(Code)
actual max pool size



getPoolMin
public int getPoolMin()(Code)
min pool size



getPstmtMax
public int getPstmtMax()(Code)
PreparedStatement cache size



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.



getRejectedFull
public int getRejectedFull()(Code)
int number of open calls that were rejected due to waiter overflow



getRejectedOpen
public int getRejectedOpen()(Code)
int number of open calls that were rejected



getRejectedOther
public int getRejectedOther()(Code)
int number of open calls that were rejected



getRejectedTimeout
public int getRejectedTimeout()(Code)
int number of open calls that were rejected by timeout



getSamplingPeriod
public int getSamplingPeriod()(Code)
sampling period in sec.



getServedOpen
public int getServedOpen()(Code)
int number of xa connection served



getTestStatement
public String getTestStatement()(Code)
test statement used when checkLevel = 2.



getTransactionIsolation
public String getTransactionIsolation()(Code)



getUrl
public String getUrl()(Code)



getUserName
public String getUserName()(Code)



getWaiterCount
public int getWaiterCount()(Code)
total nb of waiters since the datasource creation



getWaitersHigh
public int getWaitersHigh()(Code)
maximum nb of waiters since the datasource creation



getWaitersHighRecent
public int getWaitersHighRecent()(Code)
maximum nb of waiters in last sampling period



getWaitingHigh
public long getWaitingHigh()(Code)
max waiting time since the datasource creation



getWaitingHighRecent
public long getWaitingHighRecent()(Code)
max waiting time in last sampling period



getWaitingTime
public long getWaitingTime()(Code)
total waiting time since the datasource creation



getXAConnection
public XAConnection getXAConnection() throws SQLException(Code)



getXAConnection
public XAConnection getXAConnection(String user, String passwd) throws SQLException(Code)
Attempts to establish a physical database connection, using the given user name and password. The connection that is returned is one that can be used in a distributed transaction - comes from the javax.sql.XADataSource interface
Parameters:
  user - - the database user on whose behalf the connection is being made
Parameters:
  passwd - - the user's password an XAConnection object, which represents a physical connection to a data source,that can be used in a distributed transaction
throws:
  SQLException - - if a database access error occurs



isClientCase
public boolean isClientCase()(Code)
This manager is in the client case or not ? boolean true if this is the client caseTODO : must be removed. A client can lookup a datasource



openConnection
public synchronized JManagedConnection openConnection(String user, Transaction tx) throws SQLException(Code)
lookup connection in the pool for this user/tx
Parameters:
  user - user name
Parameters:
  tx - Transaction the connection is involved a free JManagedConnection (never null)
throws:
  SQLException - Cannot open a connection because the pool's max size is reached



poolConfigure
public void poolConfigure(String connchecklevel, String connmaxage, String maxopentime, String connteststmt, String pstmtmax, String minconpool, String maxconpool, String maxwaittime, String maxwaiters, String samplingperiod)(Code)
Configure the Connection pool. Called by the Container at init. Configuration can be set in datasource.properties files.
Parameters:
  connchecklevel - JDBC connection checking level
Parameters:
  connmaxage - JDBC connection maximum age
Parameters:
  maxopentime - JDBC connection maximum open time
Parameters:
  connteststmt - SQL query for test statement
Parameters:
  pstmtmax - prepare statement pool size per managed connection
Parameters:
  minconpool - Min size for the connection pool
Parameters:
  maxconpool - Max size for the connection pool
Parameters:
  maxwaittime - Max time to wait for a connection (in seconds)
Parameters:
  maxwaiters - Max nb of waiters for a connection
Parameters:
  samplingperiod - sampling period in sec.



recomputeBusy
public void recomputeBusy()(Code)
compute current min/max busyConnections



sampling
public synchronized void sampling()(Code)
make samples with some monitoring values



setCheckLevel
public void setCheckLevel(int level)(Code)

Parameters:
  level - jdbc connection checking level (0, 1, or 2)



setClassName
public void setClassName(String s) throws ClassNotFoundException(Code)



setDSName
public void setDSName(String s)(Code)

Parameters:
  s - Jndi name for the datasource



setDataSourceDescription
public void setDataSourceDescription(String dsDesc)(Code)

Parameters:
  dsDesc - the desrciption of this datasource



setDatasourceName
public void setDatasourceName(String s)(Code)



setLogWriter
public void setLogWriter(PrintWriter out) throws SQLException(Code)



setLoginTimeout
public void setLoginTimeout(int seconds) throws SQLException(Code)



setMapperName
public void setMapperName(String mappername)(Code)



setMaxAge
public void setMaxAge(int mn)(Code)

Parameters:
  mn - max age of connection in minutes



setMaxOpenTime
public void setMaxOpenTime(int mn)(Code)

Parameters:
  mn - max time of open connection in minutes



setMaxWaitTime
public void setMaxWaitTime(int sec)(Code)

Parameters:
  sec - max time to wait for a connection, in seconds



setMaxWaiters
public void setMaxWaiters(int nb)(Code)

Parameters:
  nb - max nb of waiters



setPassword
public void setPassword(String s)(Code)



setPoolMax
public synchronized void setPoolMax(int max)(Code)

Parameters:
  max - max pool size. -1 means "no limit".



setPoolMin
public synchronized void setPoolMin(int min)(Code)

Parameters:
  min - minimum connection pool size to be set.



setPstmtMax
public void setPstmtMax(int nb)(Code)

Parameters:
  nb - PreparedStatement cache size



setSamplingPeriod
public void setSamplingPeriod(int sec)(Code)

Parameters:
  sec - sampling period in sec.



setTestStatement
public void setTestStatement(String s)(Code)

Parameters:
  s - test statement



setTransactionIsolation
public void setTransactionIsolation(String level)(Code)



setUrl
public void setUrl(String s)(Code)



setUserName
public void setUserName(String s)(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.