All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----sunw.demo.encapsulatedEvents.EncapsulatedEventAdaptor
sunw.demo.encapsulatedEvents.EncapsulatedEventAdaptor is an abstract base class designed to support the dynamic generation of java.util.EventListener sub-interface adaptor classes.
These dynamically generated adaptor classes can be used to take arbitrary events and "wrap" them in sunw.demo.encapsulatedEvent.EncapsulatedEvent objects. These "encapsulated" events are then fired on the sunw.demo.encapsulatedEventListener interface.
Using this dynamic adaptor class, objects that emits events on arbitrary` sub-interfaces of java.util.EventListener can be encapsulated and delivered onto a single EventListener interface, this allowing late binding of event behaviors and filtering applications.
default constructor.
This method is called from simple EventListener method stubs of dynamic subclasses in order to create and EncapsulatedEvent and deliver it to the registered listeners.
This method is called from cracked EventListener method stubs of dynamic subclasses in order to create and EncapsulatedEvent and deliver it to the registered listeners.
EncapsulatedEventListener's may raise exceptions to the originating event source through an adaptor by throwing the actual exception within an instance of EncapsulatedEventException.
setSource sets the adaptor instance to listen to the specified source.
protected Object source
protected Method addAdaptorMethod
protected Method removeAdaptorMethod
protected Vector listeners
protected EncapsulatedEventAdaptor()
default constructor.
public static EncapsulatedEventAdaptor getEncapsulatedEventAdaptor(Class lc, Object s) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IntrospectionException
public static Class getEncapsulatedEventAdaptorClass(Class lc) throws ClassNotFoundException
public abstract Class getListenerClass()
public String getListenerClassName()
public synchronized Object getSource()
public synchronized void setSource(Object s) throws IntrospectionException, Exception
setSource sets the adaptor instance to listen to the specified source. This operation will fail if the source does not emit events on the EventListener subinterface this adaptor implements.
public void addEncapsulatedEventListener(EncapsulatedEventListener el)
public void removeEncapsulatedEventListener(EncapsulatedEventListener el)
public int getEncapsulatedListenerCount()
public Vector getEncapsulatedListeners()
protected void fire(EventObject e, Method lm) throws Exception
This method is called from simple EventListener method stubs of dynamic subclasses in order to create and EncapsulatedEvent and deliver it to the registered listeners.
protected void fire(Object a[], Method lm) throws Exception
This method is called from cracked EventListener method stubs of dynamic subclasses in order to create and EncapsulatedEvent and deliver it to the registered listeners.
protected final void handleEncapsulatedEventException(EncapsulatedEventException ex, EncapsulatedEventListener eel, Method lm) throws Exception
EncapsulatedEventListener's may raise exceptions to the originating event source through an adaptor by throwing the actual exception within an instance of EncapsulatedEventException.
This method is called to verify that it is allowable to re-raise the exception from the adaptor to the source, by checking that the listener method on the adaptor that the source delivered the original event to is permitted to throw such an exception, otherwise a RuntimeException is raised.
protected void addAdaptorToSource()
protected void removeAdaptorFromSource()
All Packages Class Hierarchy This Package Previous Next Index