sunw.demo.encapsulatedEvents
Class EncapsulatedEventAdaptorGenerator

java.lang.Object
  |
  +--java.lang.ClassLoader
        |
        +--sunw.demo.encapsulatedEvents.EncapsulatedEventAdaptorGenerator

public final class EncapsulatedEventAdaptorGenerator
extends java.lang.ClassLoader

The EncapsulatedEventAdaptorGenerator is the class responsible for dynamically generating classes that adapt arbitrary sub-interfaces of java.util.EventListener to sunw.demo.encapsulatedEvents.EncapsulatedEventListener.

The dynamically generated adaptor class is implemented as a subclass of sunw.demo.encapsulatedEvents.EncapsulatedEvent and implements the specified sub-interface of java.util.EventListener. Each listener method of the sub-interface calls into sunw.demo.encapsulatedEvents.EncapsulatedEvent to construct and EncapsulatedEvent and subsequently deliver that to the objects listening to the adaptor.


Method Summary
static java.lang.String getBaseNameFromAdaptorName(java.lang.String className)
           
protected  java.lang.Class loadClass(java.lang.String className, boolean resolve)
          loadClass will lookup classes with its Class Loader or via the system, unless the class requested is a dynamic adaptor class, then we invoke the code generator to create the adaptor class on the fly.
 
Methods inherited from class java.lang.ClassLoader
defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findResources, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadClass

protected java.lang.Class loadClass(java.lang.String className,
                                    boolean resolve)
                             throws java.lang.ClassNotFoundException
loadClass will lookup classes with its Class Loader or via the system, unless the class requested is a dynamic adaptor class, then we invoke the code generator to create the adaptor class on the fly.
Overrides:
loadClass in class java.lang.ClassLoader
Returns:
the newly loaded dynamic adaptor class.

getBaseNameFromAdaptorName

public static java.lang.String getBaseNameFromAdaptorName(java.lang.String className)
Returns:
the name of the sub-interface we are adapting from the name of the adaptor class.