com.metamatrix.core.event
Class AbstractEventSource

java.lang.Object
  extended by com.metamatrix.core.event.AbstractEventSource
All Implemented Interfaces:
EventSource
Direct Known Subclasses:
AbstractEventBroker

public abstract class AbstractEventSource
extends java.lang.Object
implements EventSource


Constructor Summary
AbstractEventSource()
           
 
Method Summary
 void addListener(java.lang.Class eventClass, EventObjectListener listener)
           
 void addListener(EventObjectListener listener)
           
 void addListeners(AbstractEventSource eventSource)
          Add to this event source all the listeners of the specified AbstractEventSource.
 java.util.List getAllListeners()
          Obtain the complete list of listeners that are registered.
 java.util.List getListeners()
          Obtain those listeners that are registered for all event classes (i.e., those that use the addListener(EventObjectListener) method).
 java.util.List getListeners(java.lang.Class eventClass)
          Obtain the listeners for the specified event class
 void removeAllListeners()
           
 void removeListener(java.lang.Class eventClass, EventObjectListener listener)
           
 void removeListener(EventObjectListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEventSource

public AbstractEventSource()
Method Detail

addListener

public void addListener(java.lang.Class eventClass,
                        EventObjectListener listener)
                 throws EventSourceException
Specified by:
addListener in interface EventSource
Throws:
EventSourceException

addListener

public void addListener(EventObjectListener listener)
                 throws EventSourceException
Specified by:
addListener in interface EventSource
Throws:
EventSourceException

removeListener

public void removeListener(java.lang.Class eventClass,
                           EventObjectListener listener)
                    throws EventSourceException
Specified by:
removeListener in interface EventSource
Throws:
EventSourceException

removeListener

public void removeListener(EventObjectListener listener)
                    throws EventSourceException
Specified by:
removeListener in interface EventSource
Throws:
EventSourceException

removeAllListeners

public void removeAllListeners()
                        throws EventSourceException
Specified by:
removeAllListeners in interface EventSource
Throws:
EventSourceException

getListeners

public java.util.List getListeners()
Description copied from interface: EventSource
Obtain those listeners that are registered for all event classes (i.e., those that use the addListener(EventObjectListener) method).

Specified by:
getListeners in interface EventSource

getAllListeners

public java.util.List getAllListeners()
Description copied from interface: EventSource
Obtain the complete list of listeners that are registered. The resulting list contains no duplicates.

Specified by:
getAllListeners in interface EventSource

getListeners

public java.util.List getListeners(java.lang.Class eventClass)
Description copied from interface: EventSource
Obtain the listeners for the specified event class

Specified by:
getListeners in interface EventSource

addListeners

public void addListeners(AbstractEventSource eventSource)
                  throws EventSourceException
Add to this event source all the listeners of the specified AbstractEventSource. This implementation is careful not to get a lock on both objects at once.

Throws:
EventSourceException


Copyright © 2009. All Rights Reserved.