Java 1.3 added the capability to dynamically create a proxy class at runtime that implements one or more interfaces. The Proxy class and the InvocationHandler interface were added to the java.lang.reflect package to support this functionality. With this capability, you can create a proxy that delegates the method calls associated with the interfaces it implements to a class that implements InvocationHandler. This interface defines a single method:
public Object invoke(Object proxy, Method method, Object args) throws Throwable
You obtain a proxy to work with an InvocationHandler using a static method of the Proxy class:
public static Object newProxyInstance(ClassLoader loader, Class interfaces, InvocationHandler ...