[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ConnectionPool.java,1.78,1.79
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2005-05-04 16:26:40
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9103/src/java/org/logicalcobwebs/proxool Modified Files: ConnectionPool.java Log Message: Only add a new connection if the definition matches Index: ConnectionPool.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPool.java,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** ConnectionPool.java 25 Mar 2004 22:02:15 -0000 1.78 --- ConnectionPool.java 4 May 2005 16:26:31 -0000 1.79 *************** *** 303,315 **** * Add a ProxyConnection to the pool * @param proxyConnection new connection */ ! protected void addProxyConnection(ProxyConnectionIF proxyConnection) { try { acquireConnectionStatusWriteLock(); ! proxyConnections.add(proxyConnection); ! connectionCountByState[proxyConnection.getStatus()]++; } finally { releaseConnectionStatusWriteLock(); } } --- 303,322 ---- * Add a ProxyConnection to the pool * @param proxyConnection new connection + * @return true if the connection was added or false if it wasn't (for instance, if the definition it + * was built with is out of date). */ ! protected boolean addProxyConnection(ProxyConnectionIF proxyConnection) { ! boolean added = false; try { acquireConnectionStatusWriteLock(); ! if (proxyConnection.getDefinition() == getDefinition()) { ! proxyConnections.add(proxyConnection); ! connectionCountByState[proxyConnection.getStatus()]++; ! added = true; ! } } finally { releaseConnectionStatusWriteLock(); } + return added; } *************** *** 1099,1104 **** Revision history: $Log$ Revision 1.78 2004/03/25 22:02:15 brenuart ! First step towards pluggable ConnectionBuilderIF & ConnectionValidatorIF. Include some minor refactoring that lead to deprecation of some PrototyperController methods. --- 1106,1114 ---- Revision history: $Log$ + Revision 1.79 2005/05/04 16:26:31 billhorsman + Only add a new connection if the definition matches + Revision 1.78 2004/03/25 22:02:15 brenuart ! First step towards pluggable ConnectionBuilderIF & ConnectionValidatorIF. Include some minor refactoring that lead to deprecation of some PrototyperController methods. |