From c3d753abd1b472f08e704422482da989dd0a4aa9 Mon Sep 17 00:00:00 2001 From: fhanik Date: Mon, 13 Jul 2009 22:29:16 +0000 Subject: [PATCH] remove not used methods git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@793733 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tomcat/jdbc/pool/DataSourceFactory.java | 29 ---------------------- 1 file changed, 29 deletions(-) diff --git a/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java b/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java index 25eb9edee..4bb355b1a 100644 --- a/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java +++ b/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java @@ -451,14 +451,6 @@ public class DataSourceFactory implements ObjectFactory { return dataSource; } - public static DataSource getDataSource(org.apache.tomcat.jdbc.pool.DataSourceProxy dataSource) { - if (dataSource instanceof DataSource) return (DataSource)dataSource; - //only return a proxy if we didn't implement the DataSource interface - DataSourceHandler handler = new DataSourceHandler(dataSource); - DataSource ds = (DataSource)Proxy.newProxyInstance(DataSourceFactory.class.getClassLoader(), new Class[] {javax.sql.DataSource.class}, handler); - return ds; - } - /** *

Parse properties from the string. Format of the string must be [propertyName=property;]*

* @param propText @@ -469,25 +461,4 @@ public class DataSourceFactory implements ObjectFactory { return PoolProperties.getProperties(propText,null); } - protected static class DataSourceHandler implements InvocationHandler { - protected org.apache.tomcat.jdbc.pool.DataSourceProxy datasource = null; - protected static HashMap methods = new HashMap(); - public DataSourceHandler(org.apache.tomcat.jdbc.pool.DataSourceProxy ds) { - this.datasource = ds; - } - - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Method m = methods.get(method); - if (m==null) { - m = datasource.getClass().getMethod(method.getName(), method.getParameterTypes()); - methods.put(method, m); - } - try { - return m.invoke(datasource, args); - }catch (InvocationTargetException t) { - throw t.getTargetException(); - } - } - - } } -- 2.11.0