[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ConnectionPoolDefinition.java,1.24,1.25
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2003-10-16 18:55:35
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv12134 Modified Files: ConnectionPoolDefinition.java Log Message: Fixed javadoc for update() and redefine() methods which were transposed. Also improved exception handling for incomplete pool definitions. Index: ConnectionPoolDefinition.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinition.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ConnectionPoolDefinition.java 30 Sep 2003 18:39:08 -0000 1.24 --- ConnectionPoolDefinition.java 16 Oct 2003 18:54:49 -0000 1.25 *************** *** 124,139 **** * @param info additional properties (for Proxool and the delegate * driver) * @throws ProxoolException if anything goes wrong */ ! protected ConnectionPoolDefinition(String url, Properties info) throws ProxoolException { this.alias = ProxoolFacade.getAlias(url); poolLog = LogFactory.getLog("org.logicalcobwebs.proxool." + alias); reset(); ! doChange(url, info, false); } /** ! * Redefine the definition. All existing properties are reset to their ! * default values * @param url the url that defines this pool * @param info additional properties (for Proxool and the delegate --- 124,141 ---- * @param info additional properties (for Proxool and the delegate * driver) + * @param explicitRegister set to true if we are registering a new pool explicitly, or false + * if it's just because we are serving a url that we haven't come across before * @throws ProxoolException if anything goes wrong */ ! protected ConnectionPoolDefinition(String url, Properties info, boolean explicitRegister) throws ProxoolException { this.alias = ProxoolFacade.getAlias(url); poolLog = LogFactory.getLog("org.logicalcobwebs.proxool." + alias); reset(); ! doChange(url, info, false, !explicitRegister); } /** ! * Update the definition. All existing properties are retained ! * and only overwritten if included in the info parameter * @param url the url that defines this pool * @param info additional properties (for Proxool and the delegate *************** *** 145,149 **** connectionPropertiesChanged = false; poolLog.debug("Updating definition"); ! doChange(url, info, false); if (connectionPropertiesChanged) { poolLog.info("Mercifully killing all current connections because of definition changes"); --- 147,151 ---- connectionPropertiesChanged = false; poolLog.debug("Updating definition"); ! doChange(url, info, false, false); if (connectionPropertiesChanged) { poolLog.info("Mercifully killing all current connections because of definition changes"); *************** *** 153,158 **** /** ! * Update the definition. All existing properties are retained ! * and only overwritten if included in the info parameter * @param url the url that defines this pool * @param info additional properties (for Proxool and the delegate --- 155,160 ---- /** ! * Redefine the definition. All existing properties are reset to their ! * default values * @param url the url that defines this pool * @param info additional properties (for Proxool and the delegate *************** *** 165,169 **** connectionPropertiesChanged = false; poolLog.debug("Redefining definition"); ! doChange(url, info, false); // Check for minimum information --- 167,171 ---- connectionPropertiesChanged = false; poolLog.debug("Redefining definition"); ! doChange(url, info, false, false); // Check for minimum information *************** *** 178,182 **** } ! private boolean doChange(String url, Properties info, boolean pretend) throws ProxoolException { boolean changed = false; --- 180,184 ---- } ! private boolean doChange(String url, Properties info, boolean pretend, boolean implicitRegister) throws ProxoolException { boolean changed = false; *************** *** 232,237 **** } ! if (getDriver() == null || getUrl() == null) { ! throw new ProxoolException("Attempt to use a pool with incomplete definition"); } --- 234,239 ---- } ! if ((getDriver() == null || getUrl() == null) && implicitRegister) { ! throw new ProxoolException("Attempt to refer to a unregistered pool by its alias '" + getAlias() + "'"); } *************** *** 1100,1104 **** public boolean isEqual(String url, Properties info) { try { ! return !doChange(url, info, true); } catch (ProxoolException e) { LOG.error("Problem checking equality", e); --- 1102,1106 ---- public boolean isEqual(String url, Properties info) { try { ! return !doChange(url, info, true, false); } catch (ProxoolException e) { LOG.error("Problem checking equality", e); *************** *** 1127,1130 **** --- 1129,1136 ---- Revision history: $Log$ + Revision 1.25 2003/10/16 18:54:49 billhorsman + Fixed javadoc for update() and redefine() methods which were transposed. Also improved exception handling for + incomplete pool definitions. + Revision 1.24 2003/09/30 18:39:08 billhorsman New test-before-use, test-after-use and fatal-sql-exception-wrapper-class properties. |