All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunw.demo.encapsulatedEvents.EncapsulatedEventAdaptorGenerator

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

public final class EncapsulatedEventAdaptorGenerator
extends 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 Index

 o getBaseNameFromAdaptorName(String)
 o loadClass(String, boolean)
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

 o loadClass
 protected Class loadClass(String className,
                           boolean resolve) throws 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.

Returns:
the newly loaded dynamic adaptor class.
Overrides:
loadClass in class ClassLoader
 o getBaseNameFromAdaptorName
 public static String getBaseNameFromAdaptorName(String className)
Returns:
the name of the sub-interface we are adapting from the name of the adaptor class.

All Packages  Class Hierarchy  This Package  Previous  Next  Index