org.jdbcdslog
Class ProxyUtils
java.lang.Object
org.jdbcdslog.ProxyUtils
public class ProxyUtils
- extends Object
- Author:
- a511990
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ProxyUtils
public ProxyUtils()
proxyForCompatibleInterfaces
public static <T> T proxyForCompatibleInterfaces(Class<?> clazz,
Class<T> requiredInterface,
InvocationHandler invocationHandler)
- Find out all interfaces from clazz that is compatible with requiredInterface,
and generate proxy base on that.
- Parameters:
clazz - requiredInterface - invocationHandler -
- Returns:
findCompatibleInterfaces
public static Class<?>[] findCompatibleInterfaces(Class<?> clazz,
Class<?> requiredInterface)
- Find all interfaces of clazz that is-a requiredInterface.
- Parameters:
clazz - requiredInterface -
- Returns:
wrapByStatementProxy
public static Statement wrapByStatementProxy(Object r)
wrapByPreparedStatementProxy
public static PreparedStatement wrapByPreparedStatementProxy(Object r,
String sql)
wrapByCallableStatementProxy
public static CallableStatement wrapByCallableStatementProxy(Object r,
String sql)
wrapByConnectionProxy
public static Connection wrapByConnectionProxy(Object r)
wrapByResultSetProxy
public static ResultSet wrapByResultSetProxy(ResultSet r)
wrapByXaConnection
public static XAConnection wrapByXaConnection(XAConnection con)
wrapByPooledConnection
public static PooledConnection wrapByPooledConnection(PooledConnection con)
wrapByConnectionSourceProxy
public static Object wrapByConnectionSourceProxy(Object r,
Class<?> interf)
wrap
public static Object wrap(Object r,
Object... args)
- Convenient helper to wrap object base on its type.
- Parameters:
r - args -
- Returns:
-
- Throws:
Exception
Copyright © 2014. All rights reserved.