[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ProxyStatement.java,1.27,1.28 WrappedConne
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2004-07-13 21:06:29
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12207/src/java/org/logicalcobwebs/proxool Modified Files: ProxyStatement.java WrappedConnection.java Log Message: Fix problem using injectable interfaces on methods that are declared in non-public classes. Index: ProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyStatement.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ProxyStatement.java 17 Jun 2004 21:56:53 -0000 1.27 --- ProxyStatement.java 13 Jul 2004 21:06:18 -0000 1.28 *************** *** 68,72 **** close(); } else { ! result = concreteMethod.invoke(getStatement(), args); } --- 68,85 ---- close(); } else { ! try { ! result = concreteMethod.invoke(getStatement(), args); ! } catch (IllegalAccessException e) { ! // This is probably because we are trying to access a non-public concrete class. But don't worry, ! // we can always use the proxy supplied method. This will only fail if we try to use an injectable ! // method on a method in a class that isn't public and for a method that isn't declared in an interface - ! // but if that is the case then that method is inaccessible by any means (even by bypassing Proxool and ! // using the vendor's driver directly). ! LOG.debug("Ignoring IllegalAccessException whilst invoking the " + concreteMethod + " concrete method and trying the " + method + " method directly."); ! // By overriding the method cached in the InvokerFacade we ensure that we only log this message once, and ! // we speed up subsequent usages by not calling the method that fails first. ! InvokerFacade.overrideConcreteMethod(getStatement().getClass(), method, method); ! result = method.invoke(getStatement(), args); ! } } *************** *** 138,141 **** --- 151,157 ---- Revision history: $Log$ + Revision 1.28 2004/07/13 21:06:18 billhorsman + Fix problem using injectable interfaces on methods that are declared in non-public classes. + Revision 1.27 2004/06/17 21:56:53 billhorsman Use MethodMapper for concrete methods. Index: WrappedConnection.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/WrappedConnection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WrappedConnection.java 2 Jun 2004 20:50:47 -0000 1.2 --- WrappedConnection.java 13 Jul 2004 21:06:21 -0000 1.3 *************** *** 134,138 **** proxyConnection.setNeedToReset(true); } ! result = concreteMethod.invoke(proxyConnection.getConnection(), args); } else { throw new SQLException("You can't perform a " + concreteMethod.getName() + " operation after the connection has been closed"); --- 134,151 ---- proxyConnection.setNeedToReset(true); } ! try { ! result = concreteMethod.invoke(proxyConnection.getConnection(), args); ! } catch (IllegalAccessException e) { ! // This is probably because we are trying to access a non-public concrete class. But don't worry, ! // we can always use the proxy supplied method. This will only fail if we try to use an injectable ! // method on a method in a class that isn't public and for a method that isn't declared in an interface - ! // but if that is the case then that method is inaccessible by any means (even by bypassing Proxool and ! // using the vendor's driver directly). ! LOG.debug("Ignoring IllegalAccessException whilst invoking the " + concreteMethod + " concrete method and trying the " + method + " method directly."); ! // By overriding the method cached in the InvokerFacade we ensure that we only log this message once, and ! // we speed up subsequent usages by not calling the method that fails first. ! InvokerFacade.overrideConcreteMethod(proxyConnection.getConnection().getClass(), method, method); ! result = method.invoke(proxyConnection.getConnection(), args); ! } } else { throw new SQLException("You can't perform a " + concreteMethod.getName() + " operation after the connection has been closed"); *************** *** 229,232 **** --- 242,248 ---- Revision history: $Log$ + Revision 1.3 2004/07/13 21:06:21 billhorsman + Fix problem using injectable interfaces on methods that are declared in non-public classes. + Revision 1.2 2004/06/02 20:50:47 billhorsman Dropped obsolete InvocationHandler reference and injectable interface stuff. |