proxool-cvs Mailing List for Proxool: Proxy JDBC Connection Pool (Page 11)
UNMAINTAINED!
Brought to you by:
billhorsman
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(12) |
Feb
(17) |
Mar
(20) |
Apr
(22) |
May
(4) |
Jun
(3) |
Jul
(11) |
Aug
(23) |
Sep
(60) |
Oct
(41) |
Nov
(15) |
Dec
(29) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(5) |
Jun
(29) |
Jul
(6) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
(8) |
Oct
(19) |
Nov
|
Dec
|
2006 |
Jan
(17) |
Feb
|
Mar
(5) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2007 |
Jan
(9) |
Feb
|
Mar
|
Apr
|
May
(4) |
Jun
(4) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <bil...@us...> - 2003-09-11 10:44:57
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv26174 Modified Files: Prototyper.java Log Message: Catch throwable not just exception during creation of connection (this will catch ClassNotFoundError too) Index: Prototyper.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/Prototyper.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Prototyper.java 10 Apr 2003 08:22:33 -0000 1.5 --- Prototyper.java 11 Sep 2003 10:44:54 -0000 1.6 *************** *** 94,98 **** buildConnection(ProxyConnection.STATUS_AVAILABLE, reason); somethingDone = true; ! } catch (Exception e) { log.error("Prototype", e); // If there's been an exception, perhaps we should stop --- 94,98 ---- buildConnection(ProxyConnection.STATUS_AVAILABLE, reason); somethingDone = true; ! } catch (Throwable e) { log.error("Prototype", e); // If there's been an exception, perhaps we should stop *************** *** 261,264 **** --- 261,268 ---- Revision history: $Log$ + Revision 1.6 2003/09/11 10:44:54 billhorsman + Catch throwable not just exception during creation of connection + (this will catch ClassNotFoundError too) + Revision 1.5 2003/04/10 08:22:33 billhorsman removed some very frequent debug |
From: <bil...@us...> - 2003-09-11 09:48:13
|
Update of /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14532/java-jdk1.2/org/logicalcobwebs/proxool Removed Files: ProxyCallableStatement.java ProxyConnection.java ProxyDatabaseMetaData.java ProxyFactory.java ProxyPreparedStatement.java ProxyStatement.java Log Message: Redundant --- ProxyCallableStatement.java DELETED --- --- ProxyConnection.java DELETED --- --- ProxyDatabaseMetaData.java DELETED --- --- ProxyFactory.java DELETED --- --- ProxyPreparedStatement.java DELETED --- --- ProxyStatement.java DELETED --- |
From: <bil...@us...> - 2003-09-11 09:48:13
|
Update of /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool/admin In directory sc8-pr-cvs1:/tmp/cvs-serv14532/java-jdk1.2/org/logicalcobwebs/proxool/admin Removed Files: StatsRoller.java Log Message: Redundant --- StatsRoller.java DELETED --- |
From: <bil...@us...> - 2003-09-11 09:38:59
|
Update of /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv12748 Removed Files: package.html Log Message: Redundant --- package.html DELETED --- |
From: <ch...@us...> - 2003-09-11 08:31:14
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl In directory sc8-pr-cvs1:/tmp/cvs-serv30120 Modified Files: Jdk14Logger.java Log Message: Stated throwing RuntimeException in construstor instead of writing to STDERR. Index: Jdk14Logger.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl/Jdk14Logger.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Jdk14Logger.java 10 Sep 2003 23:05:40 -0000 1.5 --- Jdk14Logger.java 11 Sep 2003 08:31:11 -0000 1.6 *************** *** 109,114 **** levelSEVERE = levelClass.getField("SEVERE").get(null); } catch (Exception e) { ! System.err.println("Could not create Jdk14Logger."); ! e.printStackTrace(); } } --- 109,113 ---- levelSEVERE = levelClass.getField("SEVERE").get(null); } catch (Exception e) { ! throw new RuntimeException("Could not create Jdk14Logger: " + e.getMessage()); } } |
From: <bil...@us...> - 2003-09-10 23:05:45
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl In directory sc8-pr-cvs1:/tmp/cvs-serv27688 Modified Files: Jdk14Logger.java Log Message: Removed final bits of JDK1.3 specific code Index: Jdk14Logger.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl/Jdk14Logger.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Jdk14Logger.java 10 Sep 2003 22:21:04 -0000 1.4 --- Jdk14Logger.java 10 Sep 2003 23:05:40 -0000 1.5 *************** *** 63,66 **** --- 63,67 ---- import java.lang.reflect.Method; + import java.lang.reflect.InvocationTargetException; import org.logicalcobwebs.logging.Log; *************** *** 98,101 **** --- 99,106 ---- final Class levelClass = Class.forName("java.util.logging.Level"); isLoggableMethod = loggerClass.getMethod("isLoggable", new Class[] {levelClass}); + getStackTraceMethod = Throwable.class.getMethod("getStackTrace", null); + final Class stackTraceClass = Class.forName("java.lang.StackTraceElement"); + getClassNameMethod = stackTraceClass.getMethod("getClassName", null); + getMethodNameMethod = stackTraceClass.getMethod("getMethodName", null); levelFINEST = levelClass.getField("FINEST").get(null); levelFINE = levelClass.getField("FINE").get(null); *************** *** 121,124 **** --- 126,132 ---- private Method logpExMethod = null; private Method isLoggableMethod = null; + private Method getStackTraceMethod = null; + private Method getClassNameMethod = null; + private Method getMethodNameMethod = null; private Object levelFINEST = null; *************** *** 139,150 **** // Hack (?) to get the stack trace. Throwable dummyException = new Throwable (); - StackTraceElement locations[] = dummyException.getStackTrace (); - // Caller will be the third element String cname = "unknown"; String method = "unknown"; ! if (locations != null && locations.length > 2) { ! StackTraceElement caller = locations[2]; ! cname = caller.getClassName (); ! method = caller.getMethodName (); } --- 147,166 ---- // Hack (?) to get the stack trace. Throwable dummyException = new Throwable (); String cname = "unknown"; String method = "unknown"; ! // Use reflection instead of JDK1.4 code. ! try { ! Object locations[] = (Object[]) getStackTraceMethod.invoke(dummyException, null); ! // Caller will be the third element ! if (locations != null && locations.length > 2) { ! cname = (String) getClassNameMethod.invoke(locations[2], null); ! method = (String) getMethodNameMethod.invoke(locations[2], null); ! } ! } catch (IllegalAccessException e) { ! e.printStackTrace(); ! } catch (IllegalArgumentException e) { ! e.printStackTrace(); ! } catch (InvocationTargetException e) { ! e.printStackTrace(); } |
From: <bil...@us...> - 2003-09-10 23:05:20
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl In directory sc8-pr-cvs1:/tmp/cvs-serv27575 Modified Files: Log4JCategoryLog.java Log Message: Changed deprecated setPriority(Priority.INFO) to setLevel(Level.INFO) Index: Log4JCategoryLog.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl/Log4JCategoryLog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Log4JCategoryLog.java 11 Mar 2003 00:02:07 -0000 1.3 --- Log4JCategoryLog.java 10 Sep 2003 23:05:10 -0000 1.4 *************** *** 62,69 **** package org.logicalcobwebs.logging.impl; ! import org.apache.log4j.Category; ! import org.apache.log4j.ConsoleAppender; ! import org.apache.log4j.PatternLayout; ! import org.apache.log4j.Priority; import org.logicalcobwebs.logging.Log; --- 62,66 ---- package org.logicalcobwebs.logging.impl; ! import org.apache.log4j.*; import org.logicalcobwebs.logging.Log; *************** *** 136,140 **** root.addAppender (app); ! root.setPriority (Priority.INFO); } initialized = true; --- 133,137 ---- root.addAppender (app); ! root.setLevel (Level.INFO); } initialized = true; |
From: <ch...@us...> - 2003-09-10 22:21:08
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin/jmx In directory sc8-pr-cvs1:/tmp/cvs-serv18255/src/java/org/logicalcobwebs/proxool/admin/jmx Modified Files: ConnectionPoolMBean.java Log Message: Removing > jdk 1.2 dependencies. Index: ConnectionPoolMBean.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin/jmx/ConnectionPoolMBean.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ConnectionPoolMBean.java 6 May 2003 23:15:55 -0000 1.9 --- ConnectionPoolMBean.java 10 Sep 2003 22:21:04 -0000 1.10 *************** *** 194,198 **** } else if (equalsProperty(attributeNames[i], ProxoolConstants.FATAL_SQL_EXCEPTION)) { resultList.add (new Attribute (attributeNames[i], ! this.poolProperties.getProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY))); } else if (equalsProperty(attributeNames[i], ProxoolConstants.HOUSE_KEEPING_SLEEP_TIME)) { resultList.add (new Attribute (attributeNames[i], --- 194,198 ---- } else if (equalsProperty(attributeNames[i], ProxoolConstants.FATAL_SQL_EXCEPTION)) { resultList.add (new Attribute (attributeNames[i], ! getValueOrEmpty(this.poolProperties.getProperty(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY)))); } else if (equalsProperty(attributeNames[i], ProxoolConstants.HOUSE_KEEPING_SLEEP_TIME)) { resultList.add (new Attribute (attributeNames[i], *************** *** 200,204 **** } else if (equalsProperty(attributeNames[i], ProxoolConstants.HOUSE_KEEPING_TEST_SQL)) { resultList.add (new Attribute (attributeNames[i], ! this.poolDefinition.getHouseKeepingTestSql ())); } else if (equalsProperty(attributeNames[i], ProxoolConstants.MAXIMUM_ACTIVE_TIME)) { resultList.add (new Attribute (attributeNames[i], --- 200,204 ---- } else if (equalsProperty(attributeNames[i], ProxoolConstants.HOUSE_KEEPING_TEST_SQL)) { resultList.add (new Attribute (attributeNames[i], ! getValueOrEmpty(poolDefinition.getHouseKeepingTestSql ()))); } else if (equalsProperty(attributeNames[i], ProxoolConstants.MAXIMUM_ACTIVE_TIME)) { resultList.add (new Attribute (attributeNames[i], *************** *** 525,528 **** --- 525,532 ---- } + private String getValueOrEmpty(String property) { + return property == null ? "" : property; + } + private void setIntegerAttribute(String attributeName, String propertyName, Object value, int defaultValue, Properties properties, AttributeList resultList) throws InvalidAttributeValueException { *************** *** 640,643 **** --- 644,650 ---- Revision history: $Log$ + Revision 1.10 2003/09/10 22:21:04 chr32 + Removing > jdk 1.2 dependencies. + Revision 1.9 2003/05/06 23:15:55 chr32 Moving JMX classes back in from sandbox. |
From: <ch...@us...> - 2003-09-10 22:21:08
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin In directory sc8-pr-cvs1:/tmp/cvs-serv18255/src/java/org/logicalcobwebs/proxool/admin Modified Files: StatsRoller.java Log Message: Removing > jdk 1.2 dependencies. Index: StatsRoller.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/admin/StatsRoller.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StatsRoller.java 11 Mar 2003 00:12:11 -0000 1.6 --- StatsRoller.java 10 Sep 2003 22:21:04 -0000 1.7 *************** *** 12,17 **** import java.util.Calendar; - import java.util.Timer; - import java.util.TimerTask; --- 12,15 ---- *************** *** 42,46 **** private int units; ! private Timer timer = new Timer(true); private CompositeStatisticsListener compositeStatisticsListener; --- 40,44 ---- private int units; ! private boolean running = true; private CompositeStatisticsListener compositeStatisticsListener; *************** *** 90,99 **** // Automatically trigger roll if no activity ! TimerTask tt = new TimerTask() { public void run() { ! roll(); } }; ! timer.schedule(tt, 1000, 5000); } --- 88,107 ---- // Automatically trigger roll if no activity ! final Thread t = new Thread() { ! public void run() { ! while (running) { ! try { ! Thread.sleep(5000); ! } catch (InterruptedException e) { ! LOG.debug("Interruption", e); ! } ! roll(); ! } } + }; ! t.setDaemon(true); ! t.start(); } *************** *** 102,106 **** */ protected void cancel() { ! timer.cancel(); } --- 110,114 ---- */ protected void cancel() { ! running = false; } *************** *** 181,184 **** --- 189,195 ---- Revision history: $Log$ + Revision 1.7 2003/09/10 22:21:04 chr32 + Removing > jdk 1.2 dependencies. + Revision 1.6 2003/03/11 00:12:11 billhorsman switch to concurrent package |
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv18255/src/java/org/logicalcobwebs/proxool Modified Files: FatalSQLException.java ProxyConnection.java ProxyDatabaseMetaData.java ProxyFactory.java ProxyStatement.java Log Message: Removing > jdk 1.2 dependencies. Index: FatalSQLException.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/FatalSQLException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FatalSQLException.java 5 Sep 2003 17:00:09 -0000 1.2 --- FatalSQLException.java 10 Sep 2003 22:21:04 -0000 1.3 *************** *** 31,38 **** * @param cause the SQLException that was detected as being fatal * @param reason see {@link super#SQLException(java.lang.String, java.lang.String)} ! * @param SQLState see {@link super#SQLException(java.lang.String, java.lang.String)} */ ! public FatalSQLException(SQLException cause, String reason, String SQLState) { ! super(reason, SQLState); this.cause = cause; } --- 31,38 ---- * @param cause the SQLException that was detected as being fatal * @param reason see {@link super#SQLException(java.lang.String, java.lang.String)} ! * @param sqlState see {@link super#SQLException(java.lang.String, java.lang.String)} */ ! public FatalSQLException(SQLException cause, String reason, String sqlState) { ! super(reason, sqlState); this.cause = cause; } Index: ProxyConnection.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyConnection.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ProxyConnection.java 11 Mar 2003 14:51:54 -0000 1.26 --- ProxyConnection.java 10 Sep 2003 22:21:04 -0000 1.27 *************** *** 9,13 **** import org.logicalcobwebs.logging.LogFactory; ! import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; --- 9,13 ---- import org.logicalcobwebs.logging.LogFactory; ! import net.sf.cglib.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; *************** *** 35,38 **** --- 35,40 ---- private static final String GET_META_DATA_METHOD = "getMetaData"; + private static final String FINALIZE_METHOD = "finalize"; + public ProxyConnection(Connection connection, long id, String delegateUrl, ConnectionPool connectionPool, int status) throws SQLException { super(connection, id, delegateUrl, connectionPool, status); *************** *** 52,60 **** } else if (m.getName().equals(GET_META_DATA_METHOD) && argCount == 0) { result = getMetaData(); } else { if (m.getName().startsWith(ConnectionResetter.MUTATOR_PREFIX)) { setNeedToReset(true); } ! result = m.invoke(getConnection(), args); } --- 54,64 ---- } else if (m.getName().equals(GET_META_DATA_METHOD) && argCount == 0) { result = getMetaData(); + } else if (m.getName().equals(FINALIZE_METHOD)) { + super.finalize(); } else { if (m.getName().startsWith(ConnectionResetter.MUTATOR_PREFIX)) { setNeedToReset(true); } ! result = m.invoke(getConnection(), args); } *************** *** 95,98 **** --- 99,105 ---- Revision history: $Log$ + Revision 1.27 2003/09/10 22:21:04 chr32 + Removing > jdk 1.2 dependencies. + Revision 1.26 2003/03/11 14:51:54 billhorsman more concurrency fixes relating to snapshots Index: ProxyDatabaseMetaData.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyDatabaseMetaData.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProxyDatabaseMetaData.java 3 Mar 2003 11:11:58 -0000 1.4 --- ProxyDatabaseMetaData.java 10 Sep 2003 22:21:04 -0000 1.5 *************** *** 9,13 **** import org.logicalcobwebs.logging.LogFactory; ! import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; --- 9,13 ---- import org.logicalcobwebs.logging.LogFactory; ! import net.sf.cglib.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; *************** *** 30,33 **** --- 30,35 ---- private static final String EQUALS_METHOD = "equals"; + private static final String FINALIZE_METHOD = "finalize"; + public ProxyDatabaseMetaData(Connection connection, ProxyConnectionIF proxyConnection) throws SQLException { super(connection, proxyConnection); *************** *** 43,46 **** --- 45,50 ---- } else if (m.getName().equals(EQUALS_METHOD) && argCount == 1) { result = new Boolean(equals(args[0])); + } else if (m.getName().equals(FINALIZE_METHOD)) { + super.finalize(); } else { result = m.invoke(getDatabaseMetaData(), args); *************** *** 62,65 **** --- 66,72 ---- Revision history: $Log$ + Revision 1.5 2003/09/10 22:21:04 chr32 + Removing > jdk 1.2 dependencies. + Revision 1.4 2003/03/03 11:11:58 billhorsman fixed licence Index: ProxyFactory.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyFactory.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ProxyFactory.java 7 Sep 2003 22:11:31 -0000 1.22 --- ProxyFactory.java 10 Sep 2003 22:21:04 -0000 1.23 *************** *** 9,14 **** import org.logicalcobwebs.logging.LogFactory; ! import java.lang.reflect.InvocationHandler; ! import java.lang.reflect.Proxy; import java.sql.CallableStatement; import java.sql.Connection; --- 9,14 ---- import org.logicalcobwebs.logging.LogFactory; ! import net.sf.cglib.InvocationHandler; ! import net.sf.cglib.Proxy; import java.sql.CallableStatement; import java.sql.Connection; *************** *** 126,129 **** --- 126,132 ---- Revision history: $Log$ + Revision 1.23 2003/09/10 22:21:04 chr32 + Removing > jdk 1.2 dependencies. + Revision 1.22 2003/09/07 22:11:31 billhorsman Remove very persistent debug message Index: ProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyStatement.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ProxyStatement.java 5 Sep 2003 17:01:00 -0000 1.19 --- ProxyStatement.java 10 Sep 2003 22:21:04 -0000 1.20 *************** *** 9,13 **** import org.logicalcobwebs.logging.LogFactory; ! import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; --- 9,13 ---- import org.logicalcobwebs.logging.LogFactory; ! import net.sf.cglib.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; *************** *** 123,126 **** --- 123,129 ---- Revision history: $Log$ + Revision 1.20 2003/09/10 22:21:04 chr32 + Removing > jdk 1.2 dependencies. + Revision 1.19 2003/09/05 17:01:00 billhorsman Trap and throw FatalSQLExceptions. |
From: <ch...@us...> - 2003-09-10 22:21:07
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl In directory sc8-pr-cvs1:/tmp/cvs-serv18255/src/java/org/logicalcobwebs/logging/impl Modified Files: Jdk14Logger.java Log Message: Removing > jdk 1.2 dependencies. Index: Jdk14Logger.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/logging/impl/Jdk14Logger.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Jdk14Logger.java 11 Mar 2003 00:02:07 -0000 1.3 --- Jdk14Logger.java 10 Sep 2003 22:21:04 -0000 1.4 *************** *** 62,69 **** package org.logicalcobwebs.logging.impl; ! import org.logicalcobwebs.logging.Log; ! import java.util.logging.Level; ! import java.util.logging.Logger; /** --- 62,68 ---- package org.logicalcobwebs.logging.impl; ! import java.lang.reflect.Method; ! import org.logicalcobwebs.logging.Log; /** *************** *** 89,95 **** */ public Jdk14Logger (String name) { ! ! logger = Logger.getLogger (name); ! } --- 88,110 ---- */ public Jdk14Logger (String name) { ! try { ! final Class loggerClass = Class.forName("java.util.logging.Logger"); ! final Method getLoggerMethod = loggerClass.getMethod("getLogger", new Class [] {String.class}); ! logger = getLoggerMethod.invoke(null, new Object[]{name}); ! logpMethod = logger.getClass().getMethod("logp", new Class[] {Class.forName("java.util.logging.Logger"), ! String.class, String.class, String.class}); ! logpExMethod = logger.getClass().getMethod("logp", new Class[] {Class.forName("java.util.logging.Logger"), ! String.class, String.class, String.class, Throwable.class}); ! final Class levelClass = Class.forName("java.util.logging.Level"); ! isLoggableMethod = loggerClass.getMethod("isLoggable", new Class[] {levelClass}); ! levelFINEST = levelClass.getField("FINEST").get(null); ! levelFINE = levelClass.getField("FINE").get(null); ! levelINFO = levelClass.getField("INFO").get(null); ! levelWARNING = levelClass.getField("WARNING").get(null); ! levelSEVERE = levelClass.getField("SEVERE").get(null); ! } catch (Exception e) { ! System.err.println("Could not create Jdk14Logger."); ! e.printStackTrace(); ! } } *************** *** 101,110 **** * The underlying Logger implementation we are using. */ ! private Logger logger = null; // --------------------------------------------------------- Public Methods ! private void log (Level level, String msg, Throwable ex) { // Hack (?) to get the stack trace. Throwable dummyException = new Throwable (); --- 116,140 ---- * The underlying Logger implementation we are using. */ ! private Object logger = null; ! ! private Method logpMethod = null; ! private Method logpExMethod = null; ! private Method isLoggableMethod = null; ! ! private Object levelFINEST = null; ! private Object levelFINE = null; ! private Object levelINFO = null; ! private Object levelWARNING = null; ! private Object levelSEVERE = null; ! ! ! ! ! // --------------------------------------------------------- Public Methods ! private void log (Object level, String msg, Throwable ex) { // Hack (?) to get the stack trace. Throwable dummyException = new Throwable (); *************** *** 119,126 **** } ! if (ex == null) { ! logger.logp (level, cname, method, msg); ! } else { ! logger.logp (level, cname, method, msg, ex); } } --- 149,161 ---- } ! try { ! if (ex == null) { ! logpMethod.invoke(logger, new Object[]{level, cname, method, msg}); ! } else { ! logpExMethod.invoke(logger, new Object[]{level, cname, method, msg, ex}); ! } ! } catch (Exception e) { ! throw new RuntimeException( ! "Logging of message '" + msg + "' failed" + (ex != null ? ":" + ex.getMessage() : ".")); } } *************** *** 130,134 **** */ public void debug (Object message) { ! log (Level.FINE, String.valueOf (message), null); } --- 165,169 ---- */ public void debug (Object message) { ! log (levelFINE, String.valueOf (message), null); } *************** *** 137,141 **** */ public void debug (Object message, Throwable exception) { ! log (Level.FINE, String.valueOf (message), exception); } --- 172,176 ---- */ public void debug (Object message, Throwable exception) { ! log (levelFINE, String.valueOf (message), exception); } *************** *** 144,148 **** */ public void error (Object message) { ! log (Level.SEVERE, String.valueOf (message), null); } --- 179,183 ---- */ public void error (Object message) { ! log (levelSEVERE, String.valueOf (message), null); } *************** *** 151,155 **** */ public void error (Object message, Throwable exception) { ! log (Level.SEVERE, String.valueOf (message), exception); } --- 186,190 ---- */ public void error (Object message, Throwable exception) { ! log (levelSEVERE, String.valueOf (message), exception); } *************** *** 158,162 **** */ public void fatal (Object message) { ! log (Level.SEVERE, String.valueOf (message), null); } --- 193,197 ---- */ public void fatal (Object message) { ! log (levelSEVERE, String.valueOf (message), null); } *************** *** 165,176 **** */ public void fatal (Object message, Throwable exception) { ! log (Level.SEVERE, String.valueOf (message), exception); ! } ! ! /** ! * Return the native Logger instance we are using. ! */ ! public Logger getLogger () { ! return (this.logger); } --- 200,204 ---- */ public void fatal (Object message, Throwable exception) { ! log (levelSEVERE, String.valueOf (message), exception); } *************** *** 179,183 **** */ public void info (Object message) { ! log (Level.INFO, String.valueOf (message), null); } --- 207,211 ---- */ public void info (Object message) { ! log (levelINFO, String.valueOf (message), null); } *************** *** 186,190 **** */ public void info (Object message, Throwable exception) { ! log (Level.INFO, String.valueOf (message), exception); } --- 214,218 ---- */ public void info (Object message, Throwable exception) { ! log (levelINFO, String.valueOf (message), exception); } *************** *** 193,197 **** */ public boolean isDebugEnabled () { ! return (logger.isLoggable (Level.FINE)); } --- 221,225 ---- */ public boolean isDebugEnabled () { ! return (isLoggable (levelFINE)); } *************** *** 200,204 **** */ public boolean isErrorEnabled () { ! return (logger.isLoggable (Level.SEVERE)); } --- 228,232 ---- */ public boolean isErrorEnabled () { ! return (isLoggable (levelSEVERE)); } *************** *** 207,211 **** */ public boolean isFatalEnabled () { ! return (logger.isLoggable (Level.SEVERE)); } --- 235,239 ---- */ public boolean isFatalEnabled () { ! return (isLoggable (levelSEVERE)); } *************** *** 214,218 **** */ public boolean isInfoEnabled () { ! return (logger.isLoggable (Level.INFO)); } --- 242,246 ---- */ public boolean isInfoEnabled () { ! return (isLoggable (levelINFO)); } *************** *** 221,225 **** */ public boolean isTraceEnabled () { ! return (logger.isLoggable (Level.FINEST)); } --- 249,253 ---- */ public boolean isTraceEnabled () { ! return (isLoggable (levelFINEST)); } *************** *** 228,232 **** */ public boolean isWarnEnabled () { ! return (logger.isLoggable (Level.WARNING)); } --- 256,260 ---- */ public boolean isWarnEnabled () { ! return (isLoggable (levelWARNING)); } *************** *** 235,239 **** */ public void trace (Object message) { ! log (Level.FINEST, String.valueOf (message), null); } --- 263,267 ---- */ public void trace (Object message) { ! log (levelFINEST, String.valueOf (message), null); } *************** *** 242,246 **** */ public void trace (Object message, Throwable exception) { ! log (Level.FINEST, String.valueOf (message), exception); } --- 270,274 ---- */ public void trace (Object message, Throwable exception) { ! log (levelFINEST, String.valueOf (message), exception); } *************** *** 249,253 **** */ public void warn (Object message) { ! log (Level.WARNING, String.valueOf (message), null); } --- 277,281 ---- */ public void warn (Object message) { ! log (levelWARNING, String.valueOf (message), null); } *************** *** 256,262 **** */ public void warn (Object message, Throwable exception) { ! log (Level.WARNING, String.valueOf (message), exception); } } --- 284,297 ---- */ public void warn (Object message, Throwable exception) { ! log (levelWARNING, String.valueOf (message), exception); } + private boolean isLoggable(Object level) { + try { + return ((Boolean) isLoggableMethod.invoke(logger, new Object[] {level})).booleanValue(); + } catch (Exception e) { + throw new RuntimeException("isLoggable call failed: " + e.getMessage()); + } + } } |
From: <ch...@us...> - 2003-09-10 22:21:06
|
Update of /cvsroot/proxool/proxool/lib In directory sc8-pr-cvs1:/tmp/cvs-serv18255/lib Added Files: cglib-asm-1.0.jar Log Message: Removing > jdk 1.2 dependencies. --- NEW FILE: cglib-asm-1.0.jar --- (This appears to be a binary file; contents omitted.) |
From: <bil...@us...> - 2003-09-10 22:16:44
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv17098 Modified Files: build.xml Log Message: Remove JDK specific stuff. Index: build.xml =================================================================== RCS file: /cvsroot/proxool/proxool/build.xml,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** build.xml 7 Sep 2003 22:15:04 -0000 1.60 --- build.xml 10 Sep 2003 22:16:06 -0000 1.61 *************** *** 87,126 **** <target name="evaluate-properties" > <!-- Evaluate whether we should build the source code - for JDK1.2 - --> - <condition property="build-jdk1.2"> - <equals arg1="${java.specification.version}" arg2="1.2"/> - </condition> - - <!-- - Evaluate whether we should build the source code - for JDK1.3 - --> - <condition property="build-jdk1.3"> - <equals arg1="${java.specification.version}" arg2="1.3"/> - </condition> - - <!-- - Evaluate whether we should build the source code - for JDK1.4 - --> - <condition property="build-jdk1.4"> - <equals arg1="${java.specification.version}" arg2="1.4"/> - </condition> - - <!-- - Evaluate whether we should build the source code - for JDK1.5 - --> - <condition property="build-jdk1.5"> - <equals arg1="${java.specification.version}" arg2="1.5"/> - </condition> - - <!-- - Evaluate whether we should build the source code with test classes --> --- 87,95 ---- <target name="evaluate-properties" + description="Works out what elements we should include in the build" > <!-- Evaluate whether we should build the source code with test classes --> *************** *** 163,167 **** <fileset dir="src/java-examples" includes="**/*.java"/> <fileset dir="src/java-sandbox" includes="**/*.java"/> - <fileset dir="src/java-jdk1.2" includes="**/*.java"/> <fileset dir="src/java-test" includes="**/*.java"/> --- 132,135 ---- *************** *** 183,187 **** <fileset dir="src/java-examples" includes="**/*.java"/> <fileset dir="src/java-sandbox" includes="**/*.java"/> - <fileset dir="src/java-jdk1.2" includes="**/*.java"/> <fileset dir="src/java-test" includes="**/*.java"/> --- 151,154 ---- *************** *** 199,206 **** depends="clean,init,evaluate-properties" > ! <antcall target="build-src-jdk1.2"/> ! <antcall target="build-src-jdk1.3"/> ! <antcall target="build-src-jdk1.4"/> ! <antcall target="build-src-jdk1.5"/> <antcall target="build-src-test"/> <antcall target="build-src-sandbox"/> --- 166,170 ---- depends="clean,init,evaluate-properties" > ! <antcall target="build-src-core"/> <antcall target="build-src-test"/> <antcall target="build-src-sandbox"/> *************** *** 211,214 **** --- 175,179 ---- <target name="version-stamp" + description="Adds the version and build date to the Version class" if="version" > *************** *** 259,270 **** <target ! name="build-src-jdk1.2" depends="init" ! if="build-jdk1.2" > ! <echo level="info" message="Using JDK1.2"/> ! <antcall target="build-src-common"/> ! <copy todir="${build-dir}/src/java" overwrite="yes"> ! <fileset dir="src/java-jdk1.2" includes="**/*.java"/> </copy> </target> --- 224,234 ---- <target ! name="build-src-core" depends="init" ! description="Build the core source (all that is required to run Proxool)" > ! <echo level="info" message="Using JDK1.4"/> ! <copy todir="${build-dir}/src/java" preservelastmodified="yes"> ! <fileset dir="src/java" includes="**/*.java"/> </copy> </target> *************** *** 273,280 **** name="build-src-sandbox" depends="init" if="build-sandbox" > <echo level="info" message="Using Sandbox"/> - <antcall target="build-src-common"/> <copy todir="${build-dir}/src/java" preservelastmodified="yes"> <fileset dir="src/java-sandbox" includes="**/*.java"/> --- 237,244 ---- name="build-src-sandbox" depends="init" + description="Build the source for the experimental sandbox tree" if="build-sandbox" > <echo level="info" message="Using Sandbox"/> <copy todir="${build-dir}/src/java" preservelastmodified="yes"> <fileset dir="src/java-sandbox" includes="**/*.java"/> *************** *** 283,333 **** <target - name="build-src-common" - depends="init" - > - <copy todir="${build-dir}/src/java" preservelastmodified="yes"> - <fileset - dir="src/java" - includes="**/*.java" - excludes="**/Jdk14Logger.java,**/ProxyCallableStatement.java,**/ProxyConnection.java,**/ProxyDatabaseMetData.java,**/ProxyFactory.java,**/ProxyPreparedStatement.java,**/StatsRoller.java"/> - </copy> - </target> - - <target - name="build-src-jdk1.3" - depends="init" - if="build-jdk1.3" - > - <echo level="info" message="Using JDK1.3"/> - <copy todir="${build-dir}/src/java" preservelastmodified="yes"> - <fileset dir="src/java" includes="**/*.java" excludes="**/Jdk14Logger.java"/> - </copy> - </target> - - <target - name="build-src-jdk1.4" - depends="init" - if="build-jdk1.4" - > - <echo level="info" message="Using JDK1.4"/> - <copy todir="${build-dir}/src/java" preservelastmodified="yes"> - <fileset dir="src/java" includes="**/*.java"/> - </copy> - </target> - - <target - name="build-src-jdk1.5" - depends="init" - if="build-jdk1.5" - > - <echo level="info" message="Using JDK1.5"/> - <copy todir="${build-dir}/src/java" preservelastmodified="yes"> - <fileset dir="src/java" includes="**/*.java"/> - </copy> - </target> - - <target name="build-src-test" depends="init" if="build-test" > --- 247,253 ---- <target name="build-src-test" depends="init" + description="Build the source for testing" if="build-test" > *************** *** 357,371 **** <jvmarg line="${jvmargs}"/> </java> - <!-- - <junit fork="true" printsummary="yes"> - <classpath refid="source"/> - <sysproperty key="log4jPath" value="${log4jPath}"/> - <batchtest todir="${build-dir}/reports"> - <fileset dir="src/java-test" - includes="**/PerformanceTest.java" - /> - </batchtest> - </junit> - --> </target> --- 277,280 ---- *************** *** 478,522 **** > <java classpathref="binary" classname="org.logicalcobwebs.proxool.Version"/> - </target> - - <target - name="echo-jdk" - > - <antcall target="echo-jdk12"/> - <antcall target="echo-jdk13"/> - <antcall target="echo-jdk14"/> - <antcall target="echo-jdk15"/> - </target> - - <target - name="echo-jdk12" - depends="evaluate-properties" - if="build-jdk1.2" - > - <echo level="info" message="Using JDK1.2"/> - </target> - - <target - name="echo-jdk13" - depends="evaluate-properties" - if="build-jdk1.3" - > - <echo level="info" message="Using JDK1.3"/> - </target> - - <target - name="echo-jdk14" - depends="evaluate-properties" - if="build-jdk1.4" - > - <echo level="info" message="Using JDK1.4"/> - </target> - - <target - name="echo-jdk15" - depends="evaluate-properties" - if="build-jdk1.5" - > - <echo level="info" message="Using JDK1.5"/> </target> --- 387,390 ---- |
From: <bil...@us...> - 2003-09-10 22:12:28
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv16043 Modified Files: proxool-ant.properties Log Message: added test-suite property Index: proxool-ant.properties =================================================================== RCS file: /cvsroot/proxool/proxool/proxool-ant.properties,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** proxool-ant.properties 23 Jul 2003 12:41:32 -0000 1.10 --- proxool-ant.properties 10 Sep 2003 22:12:19 -0000 1.11 *************** *** 37,38 **** --- 37,44 ---- # range: true, false # default: false + + # Test Suite - what to run when calling the "test" target + # name: test-suite + # range: any test class or suite within the project + # default: org.logicalcobwebs.proxool.GlobalTest + |
From: <bil...@us...> - 2003-09-07 22:16:25
|
Update of /cvsroot/proxool/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1974 Modified Files: build.xml Log Message: Make test-suite to run a property so it can be overridden. Add an echo-jdk target just for information. Remove ShutdownHook.java from the list of JDK specific classes. Index: build.xml =================================================================== RCS file: /cvsroot/proxool/proxool/build.xml,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** build.xml 30 Aug 2003 15:39:56 -0000 1.59 --- build.xml 7 Sep 2003 22:15:04 -0000 1.60 *************** *** 42,45 **** --- 42,48 ---- <property name="jvmargs" value=""/> + <!-- What test suite to run when calling the "test" target --> + <property name="test-suite" value="org.logicalcobwebs.proxool.GlobalTest"/> + <!-- Classpath --> <path id="source" path="${build-dir}/classes"> *************** *** 287,291 **** dir="src/java" includes="**/*.java" ! excludes="**/Jdk14Logger.java,**/ProxyCallableStatement.java,**/ProxyConnection.java,**/ProxyDatabaseMetData.java,**/ProxyFactory.java,**/ProxyPreparedStatement.java,**/ShutdownHook.java,**/StatsRoller.java"/> </copy> </target> --- 290,294 ---- dir="src/java" includes="**/*.java" ! excludes="**/Jdk14Logger.java,**/ProxyCallableStatement.java,**/ProxyConnection.java,**/ProxyDatabaseMetData.java,**/ProxyFactory.java,**/ProxyPreparedStatement.java,**/StatsRoller.java"/> </copy> </target> *************** *** 351,355 **** <java fork="yes" classpathref="source" classname="junit.textui.TestRunner" > <sysproperty key="log4jPath" value="${log4jPath}"/> ! <arg value="org.logicalcobwebs.proxool.GlobalTest"/> <jvmarg line="${jvmargs}"/> </java> --- 354,358 ---- <java fork="yes" classpathref="source" classname="junit.textui.TestRunner" > <sysproperty key="log4jPath" value="${log4jPath}"/> ! <arg value="${test-suite}"/> <jvmarg line="${jvmargs}"/> </java> *************** *** 475,478 **** --- 478,522 ---- > <java classpathref="binary" classname="org.logicalcobwebs.proxool.Version"/> + </target> + + <target + name="echo-jdk" + > + <antcall target="echo-jdk12"/> + <antcall target="echo-jdk13"/> + <antcall target="echo-jdk14"/> + <antcall target="echo-jdk15"/> + </target> + + <target + name="echo-jdk12" + depends="evaluate-properties" + if="build-jdk1.2" + > + <echo level="info" message="Using JDK1.2"/> + </target> + + <target + name="echo-jdk13" + depends="evaluate-properties" + if="build-jdk1.3" + > + <echo level="info" message="Using JDK1.3"/> + </target> + + <target + name="echo-jdk14" + depends="evaluate-properties" + if="build-jdk1.4" + > + <echo level="info" message="Using JDK1.4"/> + </target> + + <target + name="echo-jdk15" + depends="evaluate-properties" + if="build-jdk1.5" + > + <echo level="info" message="Using JDK1.5"/> </target> |
From: <bil...@us...> - 2003-09-07 22:12:55
|
Update of /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1696/src/java-jdk1.2/org/logicalcobwebs/proxool Removed Files: ShutdownHook.java Log Message: Main ShutdownHook is now JDK independent so this is redundant --- ShutdownHook.java DELETED --- |
From: <bil...@us...> - 2003-09-07 22:11:46
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1557 Modified Files: ProxyFactory.java Log Message: Remove very persistent debug message Index: ProxyFactory.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyFactory.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ProxyFactory.java 27 Aug 2003 18:03:20 -0000 1.21 --- ProxyFactory.java 7 Sep 2003 22:11:31 -0000 1.22 *************** *** 98,104 **** --- 98,106 ---- interfaces[0] = Statement.class; } + /* if (LOG.isDebugEnabled()) { LOG.debug(delegate.getClass().getName() + " is being proxied using the " + interfaces[0]); } + */ return (Statement) Proxy.newProxyInstance(delegate.getClass().getClassLoader(), interfaces, new ProxyStatement(delegate, connectionPool, proxyConnection, sqlStatement)); } *************** *** 124,127 **** --- 126,132 ---- Revision history: $Log$ + Revision 1.22 2003/09/07 22:11:31 billhorsman + Remove very persistent debug message + Revision 1.21 2003/08/27 18:03:20 billhorsman added new getDelegateConnection() method |
From: <bil...@us...> - 2003-09-07 22:10:21
|
Update of /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1353 Modified Files: GlobalTest.java Log Message: Default behaviour of test classes, if Log4J is not configured, is now DEBUG output to console. Index: GlobalTest.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-test/org/logicalcobwebs/proxool/GlobalTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** GlobalTest.java 6 May 2003 23:17:59 -0000 1.15 --- GlobalTest.java 7 Sep 2003 22:10:17 -0000 1.16 *************** *** 37,49 **** LOG.debug("Can't configure logging using " + log4jPath); } } Class.forName(ProxoolDriver.class.getName()); - /* uncomment this if you want to turn on debug loggin to the console - org.apache.log4j.BasicConfigurator.resetConfiguration(); - org.apache.log4j.BasicConfigurator.configure(); - */ - initialised = true; } --- 37,49 ---- LOG.debug("Can't configure logging using " + log4jPath); } + } else { + // Well, at least switch on debugging + System.setProperty("org.apache.commons.logging.simplelog.defaultlog", "debug"); + org.apache.log4j.BasicConfigurator.resetConfiguration(); + org.apache.log4j.BasicConfigurator.configure(); } Class.forName(ProxoolDriver.class.getName()); initialised = true; } *************** *** 85,88 **** --- 85,91 ---- Revision history: $Log$ + Revision 1.16 2003/09/07 22:10:17 billhorsman + Default behaviour of test classes, if Log4J is not configured, is now DEBUG output to console. + Revision 1.15 2003/05/06 23:17:59 chr32 Added JMX tests to GlobalTest. |
From: <bil...@us...> - 2003-09-07 22:09:31
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv1121 Modified Files: ProxoolFacade.java Log Message: Remove any registered ShutdownHooks during shutdown. Index: ProxoolFacade.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxoolFacade.java,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ProxoolFacade.java 30 Aug 2003 14:54:04 -0000 1.71 --- ProxoolFacade.java 7 Sep 2003 22:09:21 -0000 1.72 *************** *** 45,48 **** --- 45,54 ---- /** + * This is the thread that has been registered with {@link Runtime} as a + * shutdownHook. It is removed during shutdown. + */ + private static Thread shutdownHook; + + /** * Build a ConnectionPool based on this definition and then start it. * @param url defines the delegate driver and delegate url. *************** *** 214,217 **** --- 220,234 ---- } + // If a shutdown hook was registered then remove it + try { + if (shutdownHook != null) { + ShutdownHook.remove(shutdownHook); + } + } catch (Throwable t) { + if (LOG.isDebugEnabled()) { + LOG.debug("Unanticipated error during removal of ShutdownHook. Ignoring it.", t); + } + } + } *************** *** 656,659 **** --- 673,689 ---- } } + + /** + * By remembering the most recent {@link ShutdownHook} ProxoolFacade + * will know to disable it when it is {@link #shutdown}. It will gracefully + * cope with the fact that it may be shutting down by the request of the + * sutdownHook. If you don't do this and do several "hot deploys" then you + * end up with a series of shutdown hooks. We only every want one. + * @param t the thread that will be run as a shutdown hook + * @see ShutdownHook + */ + protected static void setShutdownHook(Thread t) { + shutdownHook = t; + } } *************** *** 661,664 **** --- 691,697 ---- Revision history: $Log$ + Revision 1.72 2003/09/07 22:09:21 billhorsman + Remove any registered ShutdownHooks during shutdown. + Revision 1.71 2003/08/30 14:54:04 billhorsman Checkstyle |
From: <bil...@us...> - 2003-09-07 22:05:44
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv411 Modified Files: ShutdownHook.java Log Message: Now uses reflection to add ShutdownHook to Runtime so that it is JDK independent. Using JDK1.2 will disable the shutdownHook and simply log a warning message that Proxool must be shutdown explicitly. Index: ShutdownHook.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ShutdownHook.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ShutdownHook.java 3 Mar 2003 17:07:58 -0000 1.7 --- ShutdownHook.java 7 Sep 2003 22:05:15 -0000 1.8 *************** *** 9,12 **** --- 9,15 ---- import org.logicalcobwebs.logging.LogFactory; + import java.lang.reflect.Method; + import java.lang.reflect.InvocationTargetException; + /** * This is instantiated statically by ProxoolFacade. It will automatically *************** *** 31,34 **** --- 34,56 ---- } + protected static void remove(Thread t) { + Runtime runtime = Runtime.getRuntime(); + try { + Method addShutdownHookMethod = Runtime.class.getMethod("removeShutdownHook", new Class[] {Thread.class}); + addShutdownHookMethod.invoke(runtime, new Object[] {t}); + if (LOG.isDebugEnabled()) { + LOG.debug("Removed shutdownHook"); + } + } catch (NoSuchMethodException e) { + LOG.warn("Proxool will have to be shutdown manually with ProxoolFacade.shutdown() because this version of the JDK does not support Runtime.getRuntime().addShutdownHook()"); + } catch (SecurityException e) { + LOG.error("Probelm registering sutdownHook", e); + } catch (IllegalAccessException e) { + LOG.error("Probelm registering sutdownHook", e); + } catch (InvocationTargetException e) { + LOG.error("Probelm registering sutdownHook", e); + } + } + /** * Registers this ShutdownHook with Runtime *************** *** 36,40 **** private ShutdownHook() { Thread t = new Thread(this); ! t.setName("ShutdownHook"); Runtime.getRuntime().addShutdownHook(t); } --- 58,79 ---- private ShutdownHook() { Thread t = new Thread(this); ! t.setName("ShutdownHook"); ! Runtime runtime = Runtime.getRuntime(); ! try { ! Method addShutdownHookMethod = Runtime.class.getMethod("addShutdownHook", new Class[] {Thread.class}); ! addShutdownHookMethod.invoke(runtime, new Object[] {t}); ! ProxoolFacade.setShutdownHook(t); ! if (LOG.isDebugEnabled()) { ! LOG.debug("Registered shutdownHook"); ! } ! } catch (NoSuchMethodException e) { ! LOG.warn("Proxool will have to be shutdown manually with ProxoolFacade.shutdown() because this version of the JDK does not support Runtime.getRuntime().addShutdownHook()"); ! } catch (SecurityException e) { ! LOG.error("Probelm registering sutdownHook", e); ! } catch (IllegalAccessException e) { ! LOG.error("Probelm registering sutdownHook", e); ! } catch (InvocationTargetException e) { ! LOG.error("Probelm registering sutdownHook", e); ! } } *************** *** 55,58 **** --- 94,102 ---- Revision history: $Log$ + Revision 1.8 2003/09/07 22:05:15 billhorsman + Now uses reflection to add ShutdownHook to Runtime so that it is JDK independent. Using JDK1.2 + will disable the shutdownHook and simply log a warning message that Proxool must be shutdown + explicitly. + Revision 1.7 2003/03/03 17:07:58 billhorsman name thread |
From: <bil...@us...> - 2003-09-05 17:01:16
|
Update of /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14178 Modified Files: ProxyPreparedStatement.java ProxyStatement.java Log Message: Trap and throw FatalSQLExceptions. Index: ProxyPreparedStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool/ProxyPreparedStatement.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ProxyPreparedStatement.java 31 Jan 2003 16:53:27 -0000 1.5 --- ProxyPreparedStatement.java 5 Sep 2003 17:01:12 -0000 1.6 *************** *** 50,54 **** return getPreparedStatement().executeQuery(); } catch (SQLException e) { ! testException(e); exception = e; throw e; --- 50,59 ---- return getPreparedStatement().executeQuery(); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } exception = e; throw e; *************** *** 64,68 **** return getPreparedStatement().executeUpdate(); } catch (SQLException e) { ! testException(e); exception = e; throw e; --- 69,78 ---- return getPreparedStatement().executeUpdate(); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } exception = e; throw e; *************** *** 231,235 **** return preparedStatement.execute(); } catch (SQLException e) { ! testException(e); throw e; } --- 241,250 ---- return preparedStatement.execute(); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } throw e; } *************** *** 317,320 **** --- 332,338 ---- Revision history: $Log$ + Revision 1.6 2003/09/05 17:01:12 billhorsman + Trap and throw FatalSQLExceptions. + Revision 1.5 2003/01/31 16:53:27 billhorsman checkstyle Index: ProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java-jdk1.2/org/logicalcobwebs/proxool/ProxyStatement.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ProxyStatement.java 6 Feb 2003 23:48:10 -0000 1.6 --- ProxyStatement.java 5 Sep 2003 17:01:12 -0000 1.7 *************** *** 39,43 **** return getStatement().executeQuery(sql); } catch (SQLException e) { ! testException(e); exception = e; throw e; --- 39,48 ---- return getStatement().executeQuery(sql); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } exception = e; throw e; *************** *** 53,57 **** return getStatement().executeUpdate(sql); } catch (SQLException e) { ! testException(e); exception = e; throw e; --- 58,67 ---- return getStatement().executeUpdate(sql); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } exception = e; throw e; *************** *** 67,71 **** return getStatement().executeBatch(); } catch (SQLException e) { ! testException(e); exception = e; throw e; --- 77,86 ---- return getStatement().executeBatch(); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } exception = e; throw e; *************** *** 123,127 **** return getStatement().execute(sql); } catch (SQLException e) { ! testException(e); throw e; } --- 138,147 ---- return getStatement().execute(sql); } catch (SQLException e) { ! if (testException(e)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(e); ! } ! } throw e; } *************** *** 182,185 **** --- 202,208 ---- Revision history: $Log$ + Revision 1.7 2003/09/05 17:01:12 billhorsman + Trap and throw FatalSQLExceptions. + Revision 1.6 2003/02/06 23:48:10 billhorsman Use imported logging |
From: <bil...@us...> - 2003-09-05 17:01:03
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14108 Modified Files: ProxyStatement.java Log Message: Trap and throw FatalSQLExceptions. Index: ProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyStatement.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ProxyStatement.java 3 Mar 2003 11:11:58 -0000 1.18 --- ProxyStatement.java 5 Sep 2003 17:01:00 -0000 1.19 *************** *** 81,85 **** exception = e; if (e.getTargetException() instanceof SQLException) { ! testException((SQLException) e.getTargetException()); } throw e.getTargetException(); --- 81,91 ---- exception = e; if (e.getTargetException() instanceof SQLException) { ! final SQLException sqlException = (SQLException) e.getTargetException(); ! if (testException(sqlException)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(sqlException); ! } ! } } throw e.getTargetException(); *************** *** 87,91 **** exception = e; if (e instanceof SQLException) { ! testException((SQLException) e); } throw e; --- 93,103 ---- exception = e; if (e instanceof SQLException) { ! final SQLException sqlException = (SQLException) e; ! if (testException(sqlException)) { ! // This is really a fatal one ! if (getConnectionPool().getDefinition().isWrapFatalSqlExceptions()) { ! throw new FatalSQLException(sqlException); ! } ! } } throw e; *************** *** 111,114 **** --- 123,129 ---- Revision history: $Log$ + Revision 1.19 2003/09/05 17:01:00 billhorsman + Trap and throw FatalSQLExceptions. + Revision 1.18 2003/03/03 11:11:58 billhorsman fixed licence |
From: <bil...@us...> - 2003-09-05 17:00:46
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv14056 Modified Files: ProxoolConstants.java Log Message: New wrap-fatal-sql-exceptions property. Index: ProxoolConstants.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxoolConstants.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ProxoolConstants.java 23 Jul 2003 06:54:48 -0000 1.16 --- ProxoolConstants.java 5 Sep 2003 17:00:42 -0000 1.17 *************** *** 143,146 **** --- 143,152 ---- public final String FATAL_SQL_EXCEPTION_PROPERTY = PROPERTY_PREFIX + FATAL_SQL_EXCEPTION; + /** @see #WRAP_FATAL_SQL_EXCEPTIONS_PROPERTY**/ + public final String WRAP_FATAL_SQL_EXCEPTIONS = "wrap-fatal-sql-exceptions"; + + /** @see ProxoolDriver#getPropertyInfo */ + public final String WRAP_FATAL_SQL_EXCEPTIONS_PROPERTY = PROPERTY_PREFIX + WRAP_FATAL_SQL_EXCEPTIONS; + public static final String STATISTICS = "statistics"; *************** *** 247,250 **** --- 253,259 ---- Revision history: $Log$ + Revision 1.17 2003/09/05 17:00:42 billhorsman + New wrap-fatal-sql-exceptions property. + Revision 1.16 2003/07/23 06:54:48 billhorsman draft JNDI changes (shouldn't effect normal operation) |
From: <bil...@us...> - 2003-09-05 17:00:13
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv13915 Modified Files: FatalSQLException.java Log Message: Easier construction. Index: FatalSQLException.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/FatalSQLException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FatalSQLException.java 2 Sep 2003 19:26:29 -0000 1.1 --- FatalSQLException.java 5 Sep 2003 17:00:09 -0000 1.2 *************** *** 24,35 **** private SQLException cause; /** * @param cause the SQLException that was detected as being fatal ! * @param reason see {@link super#SQLException(java.lang.String, java.lang.String, int)} ! * @param SQLState see {@link super#SQLException(java.lang.String, java.lang.String, int)} ! * @param vendorCode see {@link super#SQLException(java.lang.String, java.lang.String, int)} */ ! public FatalSQLException(SQLException cause, String reason, String SQLState, int vendorCode) { ! super(reason, SQLState, vendorCode); this.cause = cause; } --- 24,38 ---- private SQLException cause; + public FatalSQLException(SQLException cause) { + this(cause, cause.getMessage(), cause.getSQLState()); + } + /** * @param cause the SQLException that was detected as being fatal ! * @param reason see {@link super#SQLException(java.lang.String, java.lang.String)} ! * @param SQLState see {@link super#SQLException(java.lang.String, java.lang.String)} */ ! public FatalSQLException(SQLException cause, String reason, String SQLState) { ! super(reason, SQLState); this.cause = cause; } |
From: <bil...@us...> - 2003-09-05 16:59:46
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1:/tmp/cvs-serv13747 Modified Files: ConnectionPoolDefinition.java ConnectionPoolDefinitionIF.java ProxoolDriver.java Log Message: Added wrap-fatal-sql-exceptions property Index: ConnectionPoolDefinition.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinition.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** ConnectionPoolDefinition.java 30 Aug 2003 14:54:04 -0000 1.21 --- ConnectionPoolDefinition.java 5 Sep 2003 16:59:42 -0000 1.22 *************** *** 105,108 **** --- 105,110 ---- private String fatalSqlExceptionsAsString; + private boolean wrapFatalSqlExceptions = false; + private String houseKeepingTestSql; *************** *** 361,364 **** --- 363,374 ---- } } + } else if (key.equals(ProxoolConstants.WRAP_FATAL_SQL_EXCEPTIONS_PROPERTY)) { + final boolean valueAsBoolean = Boolean.valueOf(value).booleanValue(); + if (valueAsBoolean != wrapFatalSqlExceptions) { + changed = true; + if (!pretend) { + setWrapFatalSqlExceptions(valueAsBoolean); + } + } } else if (key.equals(ProxoolConstants.STATISTICS_PROPERTY)) { if (isChanged(getStatistics(), value)) { *************** *** 900,903 **** --- 910,927 ---- /** + * @see ConnectionPoolDefinitionIF#isWrapFatalSqlExceptions + */ + public boolean isWrapFatalSqlExceptions() { + return wrapFatalSqlExceptions; + } + + /** + * @see ConnectionPoolDefinitionIF#isWrapFatalSqlExceptions + */ + public void setWrapFatalSqlExceptions(boolean wrapFatalSqlExceptions) { + this.wrapFatalSqlExceptions = wrapFatalSqlExceptions; + } + + /** * @see ConnectionPoolDefinitionIF#getHouseKeepingTestSql */ *************** *** 1031,1034 **** --- 1055,1061 ---- Revision history: $Log$ + Revision 1.22 2003/09/05 16:59:42 billhorsman + Added wrap-fatal-sql-exceptions property + Revision 1.21 2003/08/30 14:54:04 billhorsman Checkstyle Index: ConnectionPoolDefinitionIF.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ConnectionPoolDefinitionIF.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ConnectionPoolDefinitionIF.java 23 Jul 2003 06:54:48 -0000 1.17 --- ConnectionPoolDefinitionIF.java 5 Sep 2003 16:59:42 -0000 1.18 *************** *** 228,241 **** --- 228,274 ---- String getDelegateProperty(String name); + /** + * If true then if a fatal SQLException is detected then it will be wrapped up + * in a {@link FatalSQLException} and that will be thrown instead. + * Range: true, false + * Default: false (original exception is thrown) + * @return whether fatal SQLExceptions are wrapped up + */ + boolean isWrapFatalSqlExceptions(); + + /** + * JNDI property + * @return the initial context factory + */ String getInitialContextFactory(); + /** + * JNDI property + * @return provider URL + */ String getProviderUrl(); + /** + * JNDI property + * @return security authentication + */ String getSecurityAuthentication(); + /** + * JNDI property + * @return security principal + */ String getSecurityPrincipal(); + /** + * JNDI property + * @return security credentials + */ String getSecurityCredentials(); + /** + * JNDI property + * @return JNDI name + */ String getJndiName(); *************** *** 245,248 **** --- 278,284 ---- Revision history: $Log$ + Revision 1.18 2003/09/05 16:59:42 billhorsman + Added wrap-fatal-sql-exceptions property + Revision 1.17 2003/07/23 06:54:48 billhorsman draft JNDI changes (shouldn't effect normal operation) Index: ProxoolDriver.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxoolDriver.java,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ProxoolDriver.java 15 Aug 2003 10:13:24 -0000 1.23 --- ProxoolDriver.java 5 Sep 2003 16:59:42 -0000 1.24 *************** *** 110,114 **** throws SQLException { ! DriverPropertyInfo[] dpi = new DriverPropertyInfo[17]; ConnectionPool cp = null; try { --- 110,114 ---- throws SQLException { ! DriverPropertyInfo[] dpi = new DriverPropertyInfo[18]; ConnectionPool cp = null; try { *************** *** 165,172 **** String.valueOf(cpd.getFatalSqlExceptions())); ! dpi[15] = buildDriverPropertyInfo(ProxoolConstants.STATISTICS_PROPERTY, String.valueOf(cpd.getStatistics())); ! dpi[16] = buildDriverPropertyInfo(ProxoolConstants.STATISTICS_LOG_LEVEL_PROPERTY, String.valueOf(cpd.getStatisticsLogLevel())); --- 165,175 ---- String.valueOf(cpd.getFatalSqlExceptions())); ! dpi[15] = buildDriverPropertyInfo(ProxoolConstants.FATAL_SQL_EXCEPTION_PROPERTY, ! String.valueOf(cpd.getFatalSqlExceptions())); ! ! dpi[16] = buildDriverPropertyInfo(ProxoolConstants.STATISTICS_PROPERTY, String.valueOf(cpd.getStatistics())); ! dpi[17] = buildDriverPropertyInfo(ProxoolConstants.STATISTICS_LOG_LEVEL_PROPERTY, String.valueOf(cpd.getStatisticsLogLevel())); *************** *** 209,212 **** --- 212,218 ---- Revision history: $Log$ + Revision 1.24 2003/09/05 16:59:42 billhorsman + Added wrap-fatal-sql-exceptions property + Revision 1.23 2003/08/15 10:13:24 billhorsman remove finalize() method |