com.gargoylesoftware.base.util
public final class ProxyUtil extends Object
Version: $Revision: 1.3 $
| Constructor Summary | |
|---|---|
| ProxyUtil() | |
| Method Summary | |
|---|---|
| static Object | createProxy(Class clazz)
Create a proxy object that implements the interface specified by 'clazz'.
|
| static Object | createProxy(Class clazz, Object[][] args)
Create a proxy object that implements the interface specified by 'clazz'.
|
Parameters: clazz The interface that the proxy will support
Returns: The new proxy object.
final Object args[][] = {
{"getAutoCommit", Boolean.TRUE},
{"getCatalog", "foobar"}
};
final Connection connection = ProxyUtil.createProxy(Connection.class, args);
Calling getAutoCommit() on this object will return true. Calling getCatalog()
on this object will return "foobar". Calling any other method will return null.
Parameters: clazz The interface that will be supported by the generated proxy args methodname/object pairs
Returns: The new proxy object