1
2
3
4
5 package net.sf.crispy.proxy;
6
7 import java.lang.reflect.InvocationHandler;
8 import java.lang.reflect.Proxy;
9
10 /**
11 * Implementation from a DynamicProxy with the jdk <code>java.lang.reflect.Proxy</code> class.
12 * This is the Default DynamicProxy (eg. if commons proxy not found).
13 *
14 * @author Linke
15 */
16 public class DynamicJdkProxy extends DynamicProxy implements InvocationHandler {
17
18 /**
19 * Create a Proxy-Object for the Interface pvClass.
20 */
21 public Object newInstance (Class pvClass) {
22 super.newInstance(pvClass);
23 Object lvProxyObject = Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[] {pvClass}, this);
24 if (log.isDebugEnabled()) { log.debug("Generated proxy for class: " + pvClass); }
25 return lvProxyObject;
26 }
27
28
29 }