[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ConnectionPoolDefinitionIF.java, 1.22, 1
UNMAINTAINED!
Brought to you by:
billhorsman
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20194/src/java/org/logicalcobwebs/proxool Modified Files: ConnectionPoolDefinitionIF.java ProxoolDataSource.java ConnectionPoolDefinition.java Log Message: Changed time (millisecond) properties from int to long: maximumConnectionLifetime, houseKeepingSleepTime, recentlyStartedThreshold, overloadWithoutRefusalLifetime, maximumActiveTime Index: ConnectionPoolDefinitionIF.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinitionIF.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ConnectionPoolDefinitionIF.java 2 Jun 2004 20:19:14 -0000 1.22 --- ConnectionPoolDefinitionIF.java 19 Jun 2007 11:33:35 -0000 1.23 *************** *** 75,79 **** /** This is the time the house keeping thread sleeps for between checks. (milliseconds) */ ! int getHouseKeepingSleepTime(); /** The maximum number of connections to the database */ --- 75,79 ---- /** This is the time the house keeping thread sleeps for between checks. (milliseconds) */ ! long getHouseKeepingSleepTime(); /** The maximum number of connections to the database */ *************** *** 81,85 **** /** The maximum amount of time that a connection exists for before it is killed (recycled). (milliseconds) */ ! int getMaximumConnectionLifetime(); /** --- 81,85 ---- /** The maximum amount of time that a connection exists for before it is killed (recycled). (milliseconds) */ ! long getMaximumConnectionLifetime(); /** *************** *** 140,144 **** differentiate between having all the connections frozen and just being really busy. */ ! int getRecentlyStartedThreshold(); /** This is the time in milliseconds after the last time that we refused a --- 140,144 ---- differentiate between having all the connections frozen and just being really busy. */ ! long getRecentlyStartedThreshold(); /** This is the time in milliseconds after the last time that we refused a *************** *** 148,157 **** Recognising an overload is easy (we refuse a connection) - it's recognising when we stop being overloaded that is hard. Hence this fudge :) */ ! int getOverloadWithoutRefusalLifetime(); /** If the housekeeper comes across a thread that has been active for longer than this then it will kill it. So make sure you set this to a number bigger than your slowest expected response! */ ! int getMaximumActiveTime(); /** --- 148,157 ---- Recognising an overload is easy (we refuse a connection) - it's recognising when we stop being overloaded that is hard. Hence this fudge :) */ ! long getOverloadWithoutRefusalLifetime(); /** If the housekeeper comes across a thread that has been active for longer than this then it will kill it. So make sure you set this to a number bigger than your slowest expected response! */ ! long getMaximumActiveTime(); /** *************** *** 349,352 **** --- 349,355 ---- Revision history: $Log$ + Revision 1.23 2007/06/19 11:33:35 billhorsman + Changed time (millisecond) properties from int to long: maximumConnectionLifetime, houseKeepingSleepTime, recentlyStartedThreshold, overloadWithoutRefusalLifetime, maximumActiveTime + Revision 1.22 2004/06/02 20:19:14 billhorsman Added injectable interface properties Index: ProxoolDataSource.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxoolDataSource.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ProxoolDataSource.java 15 May 2007 23:10:15 -0000 1.8 --- ProxoolDataSource.java 19 Jun 2007 11:33:35 -0000 1.9 *************** *** 47,60 **** private String driver; private String fatalSqlExceptionWrapperClass; ! private int houseKeepingSleepTime; private String houseKeepingTestSql; ! private int maximumActiveTime; private int maximumConnectionCount; ! private int maximumConnectionLifetime;; private int minimumConnectionCount; ! private int overloadWithoutRefusalLifetime; private String password; private int prototypeCount; ! private int recentlyStartedThreshold; private int simultaneousBuildThrottle; private String statistics; --- 47,60 ---- private String driver; private String fatalSqlExceptionWrapperClass; ! private long houseKeepingSleepTime; private String houseKeepingTestSql; ! private long maximumActiveTime; private int maximumConnectionCount; ! private long maximumConnectionLifetime;; private int minimumConnectionCount; ! private long overloadWithoutRefusalLifetime; private String password; private int prototypeCount; ! private long recentlyStartedThreshold; private int simultaneousBuildThrottle; private String statistics; *************** *** 207,211 **** * @see ConnectionPoolDefinitionIF#getMaximumConnectionLifetime */ ! public int getMaximumConnectionLifetime() { return maximumConnectionLifetime; } --- 207,211 ---- * @see ConnectionPoolDefinitionIF#getMaximumConnectionLifetime */ ! public long getMaximumConnectionLifetime() { return maximumConnectionLifetime; } *************** *** 263,267 **** * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime */ ! public int getHouseKeepingSleepTime() { return houseKeepingSleepTime; } --- 263,267 ---- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime */ ! public long getHouseKeepingSleepTime() { return houseKeepingSleepTime; } *************** *** 291,295 **** * @see ConnectionPoolDefinitionIF#getRecentlyStartedThreshold */ ! public int getRecentlyStartedThreshold() { return recentlyStartedThreshold; } --- 291,295 ---- * @see ConnectionPoolDefinitionIF#getRecentlyStartedThreshold */ ! public long getRecentlyStartedThreshold() { return recentlyStartedThreshold; } *************** *** 305,309 **** * @see ConnectionPoolDefinitionIF#getOverloadWithoutRefusalLifetime */ ! public int getOverloadWithoutRefusalLifetime() { return overloadWithoutRefusalLifetime; } --- 305,309 ---- * @see ConnectionPoolDefinitionIF#getOverloadWithoutRefusalLifetime */ ! public long getOverloadWithoutRefusalLifetime() { return overloadWithoutRefusalLifetime; } *************** *** 319,323 **** * @see ConnectionPoolDefinitionIF#getMaximumActiveTime */ ! public int getMaximumActiveTime() { return maximumActiveTime; } --- 319,323 ---- * @see ConnectionPoolDefinitionIF#getMaximumActiveTime */ ! public long getMaximumActiveTime() { return maximumActiveTime; } *************** *** 686,689 **** --- 686,692 ---- Revision history: $Log$ + Revision 1.9 2007/06/19 11:33:35 billhorsman + Changed time (millisecond) properties from int to long: maximumConnectionLifetime, houseKeepingSleepTime, recentlyStartedThreshold, overloadWithoutRefusalLifetime, maximumActiveTime + Revision 1.8 2007/05/15 23:10:15 billhorsman We must setUser and setPassword *after* setDelegateProperties otherwise the values will be overwritten. Credit Bulent Erdemir (bug 1716955) Index: ConnectionPoolDefinition.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinition.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ConnectionPoolDefinition.java 18 Jan 2006 14:40:01 -0000 1.34 --- ConnectionPoolDefinition.java 19 Jun 2007 11:33:35 -0000 1.35 *************** *** 72,76 **** private String driver; ! private int maximumConnectionLifetime;; private int prototypeCount; --- 72,76 ---- private String driver; ! private long maximumConnectionLifetime;; private int prototypeCount; *************** *** 80,92 **** private int maximumConnectionCount; ! private int houseKeepingSleepTime; private int simultaneousBuildThrottle; ! private int recentlyStartedThreshold; ! private int overloadWithoutRefusalLifetime; ! private int maximumActiveTime; private boolean verbose; --- 80,92 ---- private int maximumConnectionCount; ! private long houseKeepingSleepTime; private int simultaneousBuildThrottle; ! private long recentlyStartedThreshold; ! private long overloadWithoutRefusalLifetime; ! private long maximumActiveTime; private boolean verbose; *************** *** 312,319 **** } } else if (key.equals(ProxoolConstants.MAXIMUM_CONNECTION_LIFETIME_PROPERTY)) { ! if (getMaximumConnectionLifetime() != getInt(key, value)) { changed = true; if (!pretend) { ! setMaximumConnectionLifetime(getInt(key, value)); } } --- 312,319 ---- } } else if (key.equals(ProxoolConstants.MAXIMUM_CONNECTION_LIFETIME_PROPERTY)) { ! if (getMaximumConnectionLifetime() != getLong(key, value)) { changed = true; if (!pretend) { ! setMaximumConnectionLifetime(getLong(key, value)); } } *************** *** 346,367 **** } } else if (key.equals(ProxoolConstants.RECENTLY_STARTED_THRESHOLD_PROPERTY)) { ! if (getRecentlyStartedThreshold() != getInt(key, value)) { changed = true; if (!pretend) { ! setRecentlyStartedThreshold(getInt(key, value)); } } } else if (key.equals(ProxoolConstants.OVERLOAD_WITHOUT_REFUSAL_LIFETIME_PROPERTY)) { ! if (getOverloadWithoutRefusalLifetime() != getInt(key, value)) { changed = true; if (!pretend) { ! setOverloadWithoutRefusalLifetime(getInt(key, value)); } } } else if (key.equals(ProxoolConstants.MAXIMUM_ACTIVE_TIME_PROPERTY)) { ! if (getMaximumActiveTime() != getInt(key, value)) { changed = true; if (!pretend) { ! setMaximumActiveTime(getInt(key, value)); } } --- 346,367 ---- } } else if (key.equals(ProxoolConstants.RECENTLY_STARTED_THRESHOLD_PROPERTY)) { ! if (getRecentlyStartedThreshold() != getLong(key, value)) { changed = true; if (!pretend) { ! setRecentlyStartedThreshold(getLong(key, value)); } } } else if (key.equals(ProxoolConstants.OVERLOAD_WITHOUT_REFUSAL_LIFETIME_PROPERTY)) { ! if (getOverloadWithoutRefusalLifetime() != getLong(key, value)) { changed = true; if (!pretend) { ! setOverloadWithoutRefusalLifetime(getLong(key, value)); } } } else if (key.equals(ProxoolConstants.MAXIMUM_ACTIVE_TIME_PROPERTY)) { ! if (getMaximumActiveTime() != getLong(key, value)) { changed = true; if (!pretend) { ! setMaximumActiveTime(getLong(key, value)); } } *************** *** 502,509 **** boolean changed = false; if (key.equals(ProxoolConstants.HOUSE_KEEPING_SLEEP_TIME_PROPERTY)) { ! if (getHouseKeepingSleepTime() != getInt(key, value)) { changed = true; if (!pretend) { ! setHouseKeepingSleepTime(getInt(key, value)); } } --- 502,509 ---- boolean changed = false; if (key.equals(ProxoolConstants.HOUSE_KEEPING_SLEEP_TIME_PROPERTY)) { ! if (getHouseKeepingSleepTime() != getLong(key, value)) { changed = true; if (!pretend) { ! setHouseKeepingSleepTime(getLong(key, value)); } } *************** *** 561,564 **** --- 561,572 ---- } + private long getLong(String key, String value) throws ProxoolException { + try { + return Long.parseLong(value); + } catch (NumberFormatException e) { + throw new ProxoolException("'" + key + "' property must be a long. Found '" + value + "' instead."); + } + } + private static boolean isChanged(String oldValue, String newValue) { boolean changed = false; *************** *** 744,748 **** * @see ConnectionPoolDefinitionIF#getMaximumConnectionLifetime */ ! public int getMaximumConnectionLifetime() { return maximumConnectionLifetime; } --- 752,756 ---- * @see ConnectionPoolDefinitionIF#getMaximumConnectionLifetime */ ! public long getMaximumConnectionLifetime() { return maximumConnectionLifetime; } *************** *** 751,755 **** * @see ConnectionPoolDefinitionIF#getMaximumConnectionLifetime */ ! public void setMaximumConnectionLifetime(int maximumConnectionLifetime) { this.maximumConnectionLifetime = maximumConnectionLifetime; } --- 759,763 ---- * @see ConnectionPoolDefinitionIF#getMaximumConnectionLifetime */ ! public void setMaximumConnectionLifetime(long maximumConnectionLifetime) { this.maximumConnectionLifetime = maximumConnectionLifetime; } *************** *** 800,804 **** * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime */ ! public int getHouseKeepingSleepTime() { return houseKeepingSleepTime; } --- 808,812 ---- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime */ ! public long getHouseKeepingSleepTime() { return houseKeepingSleepTime; } *************** *** 807,811 **** * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime */ ! public void setHouseKeepingSleepTime(int houseKeepingSleepTime) { this.houseKeepingSleepTime = houseKeepingSleepTime; } --- 815,819 ---- * @see ConnectionPoolDefinitionIF#getHouseKeepingSleepTime */ ! public void setHouseKeepingSleepTime(long houseKeepingSleepTime) { this.houseKeepingSleepTime = houseKeepingSleepTime; } *************** *** 918,922 **** * @see ConnectionPoolDefinitionIF#getRecentlyStartedThreshold */ ! public int getRecentlyStartedThreshold() { return recentlyStartedThreshold; } --- 926,930 ---- * @see ConnectionPoolDefinitionIF#getRecentlyStartedThreshold */ ! public long getRecentlyStartedThreshold() { return recentlyStartedThreshold; } *************** *** 925,929 **** * @see ConnectionPoolDefinitionIF#getRecentlyStartedThreshold */ ! public void setRecentlyStartedThreshold(int recentlyStartedThreshold) { this.recentlyStartedThreshold = recentlyStartedThreshold; } --- 933,937 ---- * @see ConnectionPoolDefinitionIF#getRecentlyStartedThreshold */ ! public void setRecentlyStartedThreshold(long recentlyStartedThreshold) { this.recentlyStartedThreshold = recentlyStartedThreshold; } *************** *** 932,936 **** * @see ConnectionPoolDefinitionIF#getOverloadWithoutRefusalLifetime */ ! public int getOverloadWithoutRefusalLifetime() { return overloadWithoutRefusalLifetime; } --- 940,944 ---- * @see ConnectionPoolDefinitionIF#getOverloadWithoutRefusalLifetime */ ! public long getOverloadWithoutRefusalLifetime() { return overloadWithoutRefusalLifetime; } *************** *** 939,943 **** * @see ConnectionPoolDefinitionIF#getOverloadWithoutRefusalLifetime */ ! public void setOverloadWithoutRefusalLifetime(int overloadWithoutRefusalLifetime) { this.overloadWithoutRefusalLifetime = overloadWithoutRefusalLifetime; } --- 947,951 ---- * @see ConnectionPoolDefinitionIF#getOverloadWithoutRefusalLifetime */ ! public void setOverloadWithoutRefusalLifetime(long overloadWithoutRefusalLifetime) { this.overloadWithoutRefusalLifetime = overloadWithoutRefusalLifetime; } *************** *** 946,950 **** * @see ConnectionPoolDefinitionIF#getMaximumActiveTime */ ! public int getMaximumActiveTime() { return maximumActiveTime; } --- 954,958 ---- * @see ConnectionPoolDefinitionIF#getMaximumActiveTime */ ! public long getMaximumActiveTime() { return maximumActiveTime; } *************** *** 953,957 **** * @see ConnectionPoolDefinitionIF#getMaximumActiveTime */ ! public void setMaximumActiveTime(int maximumActiveTime) { this.maximumActiveTime = maximumActiveTime; } --- 961,965 ---- * @see ConnectionPoolDefinitionIF#getMaximumActiveTime */ ! public void setMaximumActiveTime(long maximumActiveTime) { this.maximumActiveTime = maximumActiveTime; } *************** *** 1361,1364 **** --- 1369,1375 ---- Revision history: $Log$ + Revision 1.35 2007/06/19 11:33:35 billhorsman + Changed time (millisecond) properties from int to long: maximumConnectionLifetime, houseKeepingSleepTime, recentlyStartedThreshold, overloadWithoutRefusalLifetime, maximumActiveTime + Revision 1.34 2006/01/18 14:40:01 billhorsman Unbundled Jakarta's Commons Logging. |