sunw.demo.encapsulatedEvents
Interface EncapsulatedEventManager


public interface EncapsulatedEventManager

Containers or other "manager"-like objects wishing to offer an encapsulated event stream from its "set" of containees or "managed" objects, should implement this interface to expose this facility.

Arbitrary objects wishing to observe the event stream from a particular event source, should locate that event sources EncapsulatedEventManager and use this interface on that instance to obtain such an event stream.


Method Summary
 void addEncapsulatedEventListener(java.lang.Object s, EncapsulatedEventListener eel)
           Adds the listener eel to the source s to receive ALL events s emits as encpasulated events.
 void addEncapsulatedEventListener(java.lang.Object s, EncapsulatedEventListener eel, java.lang.Class[] lc)
           Adds the listener eel to the source s to receive the events enumerated by lc that s emits.
 java.lang.Class[] getSourceEventListenerInterfaces(java.lang.Object s)
           Called to determine the events that a particular source emits.
 void removeEncapsulatedEventListener(java.lang.Object s, EncapsulatedEventListener eel)
           Removes the listener eel from the source s, thus unregistering eel from receiving encapsulated events for all the events that s emits.
 void removeEncapsulatedEventListener(java.lang.Object s, EncapsulatedEventListener eel, java.lang.Class[] lc)
           Removes the listener eel from the source s, thus unregistering for encapsulated events from s enumerated by lc.
 

Method Detail

getSourceEventListenerInterfaces

public java.lang.Class[] getSourceEventListenerInterfaces(java.lang.Object s)

Called to determine the events that a particular source emits. Will throw IllegalArgumentException if s is not managed by this EncapsulatedEventManager.

Parameters:
s - the event source
Returns:
list of java.util.EventListener sub-interfaces that s sources or null.
Throws:
java.lang.IllegalArgumentException -  
NullPointerException -  

addEncapsulatedEventListener

public void addEncapsulatedEventListener(java.lang.Object s,
                                         EncapsulatedEventListener eel)

Adds the listener eel to the source s to receive ALL events s emits as encpasulated events. Will throw IllegalArgumentException if s is not managed by this EncapsulatedEventManager.

Parameters:
s - the event source
eel - the listener
Throws:
java.lang.IllegalArgumentException -  
NullPointerException -  

removeEncapsulatedEventListener

public void removeEncapsulatedEventListener(java.lang.Object s,
                                            EncapsulatedEventListener eel)

Removes the listener eel from the source s, thus unregistering eel from receiving encapsulated events for all the events that s emits. Will throw IllegalArgumentException if s is not managed by this EncapsulatedEventManager.

Parameters:
s - the event source
eel - the listener
Throws:
java.lang.IllegalArgumentException -  
NullPointerException -  

addEncapsulatedEventListener

public void addEncapsulatedEventListener(java.lang.Object s,
                                         EncapsulatedEventListener eel,
                                         java.lang.Class[] lc)

Adds the listener eel to the source s to receive the events enumerated by lc that s emits. Will throw IllegalArgumentException if s is not managed by this EncapsulatedEventManager or if lc contains a reference to a Class that s does not emit events on.

Parameters:
s - the event source
eel - the listener
lc - the list of events to register the eel to receive.
Throws:
java.lang.IllegalArgumentException -  
NullPointerException -  

removeEncapsulatedEventListener

public void removeEncapsulatedEventListener(java.lang.Object s,
                                            EncapsulatedEventListener eel,
                                            java.lang.Class[] lc)

Removes the listener eel from the source s, thus unregistering for encapsulated events from s enumerated by lc. Will throw IllegalArgumentException if s is not managed by this EncapsulatedEventManager or if lc contains a reference to a Class that s does not emit events on.

Parameters:
s - the event source
eel - the listener
lc - the list of events to unregister the eel from receiving.
Throws:
java.lang.IllegalArgumentException -  
NullPointerException -