[Proxool-cvs] proxool/src/java/org/logicalcobwebs/proxool ProxyStatement.java,1.26,1.27
UNMAINTAINED!
Brought to you by:
billhorsman
From: <bil...@us...> - 2004-06-17 21:57:02
|
Update of /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10439/src/java/org/logicalcobwebs/proxool Modified Files: ProxyStatement.java Log Message: Use MethodMapper for concrete methods. Index: ProxyStatement.java =================================================================== RCS file: /cvsroot/proxool/proxool/src/java/org/logicalcobwebs/proxool/ProxyStatement.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** ProxyStatement.java 2 Jun 2004 20:48:14 -0000 1.26 --- ProxyStatement.java 17 Jun 2004 21:56:53 -0000 1.27 *************** *** 12,15 **** --- 12,16 ---- import org.logicalcobwebs.cglib.proxy.MethodProxy; import org.logicalcobwebs.cglib.proxy.InvocationHandler; + import org.logicalcobwebs.proxool.proxy.InvokerFacade; import java.lang.reflect.InvocationTargetException; *************** *** 57,70 **** final int argCount = args != null ? args.length : 0; // We need to remember an exceptions that get thrown so that we can optionally // pass them to the onExecute() call below Exception exception = null; try { ! if (method.getName().equals(EQUALS_METHOD) && argCount == 1) { result = new Boolean(equals(args[0])); ! } else if (method.getName().equals(CLOSE_METHOD) && argCount == 0) { close(); } else { ! result = method.invoke(getStatement(), args); } --- 58,72 ---- final int argCount = args != null ? args.length : 0; + Method concreteMethod = InvokerFacade.getConcreteMethod(getStatement().getClass(), method); // We need to remember an exceptions that get thrown so that we can optionally // pass them to the onExecute() call below Exception exception = null; try { ! if (concreteMethod.getName().equals(EQUALS_METHOD) && argCount == 1) { result = new Boolean(equals(args[0])); ! } else if (concreteMethod.getName().equals(CLOSE_METHOD) && argCount == 0) { close(); } else { ! result = concreteMethod.invoke(getStatement(), args); } *************** *** 74,81 **** // What sort of method is it ! if (method.getName().equals(SET_NULL_METHOD) && argCount > 0 && args[0] instanceof Integer) { int index = ((Integer) args[0]).intValue(); putParameter(index, null); ! } else if (method.getName().startsWith(SET_PREFIX) && argCount > 1 && args[0] instanceof Integer) { int index = ((Integer) args[0]).intValue(); putParameter(index, args[1]); --- 76,83 ---- // What sort of method is it ! if (concreteMethod.getName().equals(SET_NULL_METHOD) && argCount > 0 && args[0] instanceof Integer) { int index = ((Integer) args[0]).intValue(); putParameter(index, null); ! } else if (concreteMethod.getName().startsWith(SET_PREFIX) && argCount > 1 && args[0] instanceof Integer) { int index = ((Integer) args[0]).intValue(); putParameter(index, args[1]); *************** *** 107,111 **** } finally { ! if (method.getName().equals(ADD_BATCH_METHOD)) { // If we have just added a batch call then we need to update the sql log if (argCount > 0 && args[0] instanceof String) { --- 109,113 ---- } finally { ! if (concreteMethod.getName().equals(ADD_BATCH_METHOD)) { // If we have just added a batch call then we need to update the sql log if (argCount > 0 && args[0] instanceof String) { *************** *** 113,120 **** } appendToSqlLog(); ! } else if (method.getName().equals(EXECUTE_BATCH_METHOD)) { // executing a batch should do a trace trace(startTime, exception); ! } else if (method.getName().startsWith(EXECUTE_FRAGMENT)) { // executing should update the log and do a trace if (argCount > 0 && args[0] instanceof String) { --- 115,122 ---- } appendToSqlLog(); ! } else if (concreteMethod.getName().equals(EXECUTE_BATCH_METHOD)) { // executing a batch should do a trace trace(startTime, exception); ! } else if (concreteMethod.getName().startsWith(EXECUTE_FRAGMENT)) { // executing should update the log and do a trace if (argCount > 0 && args[0] instanceof String) { *************** *** 136,139 **** --- 138,144 ---- Revision history: $Log$ + Revision 1.27 2004/06/17 21:56:53 billhorsman + Use MethodMapper for concrete methods. + Revision 1.26 2004/06/02 20:48:14 billhorsman Dropped obsolete InvocationHandler reference. |