Author: fhanik Date: Mon Jul 13 22:29:16 2009 New Revision: 793733 URL: http://svn.apache.org/viewvc?rev=793733&view=rev Log: remove not used methods
Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java Modified: tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java?rev=793733&r1=793732&r2=793733&view=diff ============================================================================== --- tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java (original) +++ tomcat/trunk/modules/jdbc-pool/java/org/apache/tomcat/jdbc/pool/DataSourceFactory.java Mon Jul 13 22:29:16 2009 @@ -451,14 +451,6 @@ 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; - } - /** * <p>Parse properties from the string. Format of the string must be [propertyName=property;]*<p> * @param propText @@ -469,25 +461,4 @@ return PoolProperties.getProperties(propText,null); } - protected static class DataSourceHandler implements InvocationHandler { - protected org.apache.tomcat.jdbc.pool.DataSourceProxy datasource = null; - protected static HashMap<Method,Method> methods = new HashMap<Method,Method>(); - 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(); - } - } - - } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org