This functionality allows the application developer to have complete control over the behavior of method invocations. Unchanged from the original article. These classes require the Dynamic Proxy API introduced in Java 2 SE version 1.3. You can download a beta version of J2SE 1.3 from the Java Developer Connection. You will need to register at the Java Developer Connection to gain access.
Registration is free.
In the GenericListener implementation, DefaultInvoker is a static inner class which implements the java.lang.reflect.InvocationHandler handler interface. It also handles default return values for any other method that the subclass doesn't handle. The first step is the creation of an InvocationHandler object from the DefaultInvoker class. An instance of a dynamic listener class is created with the java.lang.reflect.Proxy.newProxyInstance factory method using the listener interface and the created handler object. The dynamic listener class instance is returned to the calling method.