[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ProxyFactory.java,1.29,1.30 WrappedConnect
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2005-05-04 16:31:50
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10759/src/java/org/logicalcobwebs/proxool Modified Files: ProxyFactory.java WrappedConnection.java Log Message: Use the definition referenced by the proxy connection rather than the pool instead. Index: ProxyFactory.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyFactory.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ProxyFactory.java 27 Jul 2004 21:44:15 -0000 1.29 --- ProxyFactory.java 4 May 2005 16:31:41 -0000 1.30 *************** *** 60,64 **** Object delegate = Enhancer.create( null, ! getInterfaces(proxyConnection.getConnection().getClass(), proxyConnection.getConnectionPool()), wrappedConnection); return (Connection) delegate; --- 60,64 ---- Object delegate = Enhancer.create( null, ! getInterfaces(proxyConnection.getConnection().getClass(), proxyConnection.getDefinition()), wrappedConnection); return (Connection) delegate; *************** *** 100,104 **** Object o = Enhancer.create( null, ! getInterfaces(delegate.getClass(), connectionPool), new ProxyStatement(delegate, connectionPool, proxyConnection, sqlStatement)); /* --- 100,104 ---- Object o = Enhancer.create( null, ! getInterfaces(delegate.getClass(), proxyConnection.getDefinition()), new ProxyStatement(delegate, connectionPool, proxyConnection, sqlStatement)); /* *************** *** 124,138 **** * @return an array of classes (all interfaces) that this class implements. */ ! private static Class[] getInterfaces(Class clazz, ConnectionPool connectionPool) { Class[] interfaceArray = (Class[]) interfaceMap.get(clazz); if (interfaceArray == null) { Set interfaces = new HashSet(); traverseInterfacesRecursively(interfaces, clazz); ! if (connectionPool != null) { // Work out which interface we should be injecting (if it has been configured). Make sure // we check CallableStatement then PreparedStatement then Statement or all three will get // caught by Statement if (Connection.class.isAssignableFrom(clazz)) { ! Class injectableClass = connectionPool.getDefinition().getInjectableConnectionInterface(); // Inject it if it was configured. if (injectableClass != null) { --- 124,138 ---- * @return an array of classes (all interfaces) that this class implements. */ ! private static Class[] getInterfaces(Class clazz, ConnectionPoolDefinitionIF cpd) { Class[] interfaceArray = (Class[]) interfaceMap.get(clazz); if (interfaceArray == null) { Set interfaces = new HashSet(); traverseInterfacesRecursively(interfaces, clazz); ! if (cpd != null) { // Work out which interface we should be injecting (if it has been configured). Make sure // we check CallableStatement then PreparedStatement then Statement or all three will get // caught by Statement if (Connection.class.isAssignableFrom(clazz)) { ! Class injectableClass = cpd.getInjectableConnectionInterface(); // Inject it if it was configured. if (injectableClass != null) { *************** *** 147,151 **** LOG.debug("Getting injectableCallableStatementInterface"); } ! Class injectableClass = connectionPool.getDefinition().getInjectableCallableStatementInterface(); // Inject it if it was configured. if (injectableClass != null) { --- 147,151 ---- LOG.debug("Getting injectableCallableStatementInterface"); } ! Class injectableClass = cpd.getInjectableCallableStatementInterface(); // Inject it if it was configured. if (injectableClass != null) { *************** *** 157,161 **** } if (PreparedStatement.class.isAssignableFrom(clazz)) { ! Class injectableClass = connectionPool.getDefinition().getInjectablePreparedStatementInterface(); // Inject it if it was configured. if (injectableClass != null) { --- 157,161 ---- } if (PreparedStatement.class.isAssignableFrom(clazz)) { ! Class injectableClass = cpd.getInjectablePreparedStatementInterface(); // Inject it if it was configured. if (injectableClass != null) { *************** *** 167,171 **** } if (Statement.class.isAssignableFrom(clazz)) { ! Class injectableClass = connectionPool.getDefinition().getInjectableStatementInterface(); // Inject it if it was configured. if (injectableClass != null) { --- 167,171 ---- } if (Statement.class.isAssignableFrom(clazz)) { ! Class injectableClass = cpd.getInjectableStatementInterface(); // Inject it if it was configured. if (injectableClass != null) { *************** *** 287,290 **** --- 287,293 ---- Revision history: $Log$ + Revision 1.30 2005/05/04 16:31:41 billhorsman + Use the definition referenced by the proxy connection rather than the pool instead. + Revision 1.29 2004/07/27 21:44:15 billhorsman Remove insane amount of debug logging. Index: WrappedConnection.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/WrappedConnection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WrappedConnection.java 13 Jul 2004 21:06:21 -0000 1.3 --- WrappedConnection.java 4 May 2005 16:31:41 -0000 1.4 *************** *** 61,65 **** this.proxyConnection = proxyConnection; this.id = proxyConnection.getId(); ! this.alias= proxyConnection.getConnectionPool().getDefinition().getAlias(); } --- 61,65 ---- this.proxyConnection = proxyConnection; this.id = proxyConnection.getId(); ! this.alias= proxyConnection.getDefinition().getAlias(); } *************** *** 175,180 **** } catch (InvocationTargetException e) { // We might get a fatal exception here. Let's test for it. ! if (FatalSqlExceptionHelper.testException(proxyConnection.getConnectionPool().getDefinition(), e.getTargetException())) { ! FatalSqlExceptionHelper.throwFatalSQLException(proxyConnection.getConnectionPool().getDefinition().getFatalSqlExceptionWrapper(), e.getTargetException()); } throw e.getTargetException(); --- 175,180 ---- } catch (InvocationTargetException e) { // We might get a fatal exception here. Let's test for it. ! if (FatalSqlExceptionHelper.testException(proxyConnection.getDefinition(), e.getTargetException())) { ! FatalSqlExceptionHelper.throwFatalSQLException(proxyConnection.getDefinition().getFatalSqlExceptionWrapper(), e.getTargetException()); } throw e.getTargetException(); *************** *** 183,188 **** } catch (Exception e) { LOG.error("Unexpected invocation exception", e); ! if (FatalSqlExceptionHelper.testException(proxyConnection.getConnectionPool().getDefinition(), e)) { ! FatalSqlExceptionHelper.throwFatalSQLException(proxyConnection.getConnectionPool().getDefinition().getFatalSqlExceptionWrapper(), e); } throw new RuntimeException("Unexpected invocation exception: " --- 183,188 ---- } catch (Exception e) { LOG.error("Unexpected invocation exception", e); ! if (FatalSqlExceptionHelper.testException(proxyConnection.getDefinition(), e)) { ! FatalSqlExceptionHelper.throwFatalSQLException(proxyConnection.getDefinition().getFatalSqlExceptionWrapper(), e); } throw new RuntimeException("Unexpected invocation exception: " *************** *** 242,245 **** --- 242,248 ---- Revision history: $Log$ + Revision 1.4 2005/05/04 16:31:41 billhorsman + Use the definition referenced by the proxy connection rather than the pool instead. + Revision 1.3 2004/07/13 21:06:21 billhorsman Fix problem using injectable interfaces on methods that are declared in non-public classes. |