org.mobicents.protocols.smpp.event
Class AbstractEventDispatcher

java.lang.Object
  extended by org.mobicents.protocols.smpp.event.AbstractEventDispatcher
All Implemented Interfaces:
EventDispatcher
Direct Known Subclasses:
SimpleEventDispatcher, TaskExecutorEventDispatcher

public abstract class AbstractEventDispatcher
extends Object
implements EventDispatcher

Parent class for event dispatchers that maintain their observers in a java.util.List.

Version:
$Id: AbstractEventDispatcher.java 452 2009-01-15 16:56:36Z orank $

Constructor Summary
AbstractEventDispatcher()
           
 
Method Summary
 void addObserver(SessionObserver observer)
          Add an observer to this event dispatcher.
 boolean contains(SessionObserver observer)
           
protected  SessionObserver[] getObserverList()
          Get the list of observers as an array.
 Collection<SessionObserver> getObservers()
          Get a read-only collection view of all the observers registered with this event dispatcher.
 Iterator<SessionObserver> observerIterator()
          Get an iterator over the currently registered observers.
 void removeObserver(SessionObserver observer)
          Remove an observer from this event dispatcher.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mobicents.protocols.smpp.event.EventDispatcher
destroy, init, notifyObservers, notifyObservers
 

Constructor Detail

AbstractEventDispatcher

public AbstractEventDispatcher()
Method Detail

addObserver

public void addObserver(SessionObserver observer)
Description copied from interface: EventDispatcher
Add an observer to this event dispatcher.

Specified by:
addObserver in interface EventDispatcher
Parameters:
observer - the observer object to add.

removeObserver

public void removeObserver(SessionObserver observer)
Description copied from interface: EventDispatcher
Remove an observer from this event dispatcher.

Specified by:
removeObserver in interface EventDispatcher
Parameters:
observer - the observer object to remove from the registered observers.

getObservers

public Collection<SessionObserver> getObservers()
Description copied from interface: EventDispatcher
Get a read-only collection view of all the observers registered with this event dispatcher. This is useful for copying all of the observers registered on one EventDispatcher into another.

Specified by:
getObservers in interface EventDispatcher
Returns:
A read-only collection of all the observers registered with this dispatcher.

observerIterator

public Iterator<SessionObserver> observerIterator()
Description copied from interface: EventDispatcher
Get an iterator over the currently registered observers.

Specified by:
observerIterator in interface EventDispatcher
Returns:
an iterator object which iterates over all registered observers.

contains

public boolean contains(SessionObserver observer)

size

public int size()

getObserverList

protected SessionObserver[] getObserverList()
Get the list of observers as an array.

Returns:
An array of all registered observers.


Copyright © 2011 Mobicents. All Rights Reserved.