|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mobicents.protocols.smpp.event.AbstractEventDispatcher
org.mobicents.protocols.smpp.event.SimpleEventDispatcher
public class SimpleEventDispatcher
A simple implementation of the event dispatcher interface. This
implementation simply iterates over the set of registered observers and
notifies each of the event in turn. This means that whatever thread the
Connection object uses to call into this object will be
blocked, from the Connection's point of view, until every
observer has successfully processed the event.
Adding and removing observers from an instance of this class is protected
against multi-threaded access. However, event and packet notification
is not. If an event notification is currently in progress and another
thread modifies the set of registered observers, then it is possible for
the new observer to receive events before the call to addObserver
is complete.
com.adenki.smpp.event.EventDispatcher| Constructor Summary | |
|---|---|
SimpleEventDispatcher()
Create a new SimpleEventDispatcher. |
|
SimpleEventDispatcher(SessionObserver observer)
Create a new SimpleEventDispatcher and register one observer on it. |
|
| Method Summary | |
|---|---|
void |
destroy()
Event dispatcher clean up. |
void |
init()
Initialise the event dispatcher. |
void |
notifyObservers(Session conn,
SMPPEvent event)
Notify registered observers of an SMPP event. |
void |
notifyObservers(Session conn,
SMPPPacket packet)
Notify registered observers of an incoming SMPP packet. |
| Methods inherited from class org.mobicents.protocols.smpp.event.AbstractEventDispatcher |
|---|
addObserver, contains, getObserverList, getObservers, observerIterator, removeObserver, size |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleEventDispatcher()
public SimpleEventDispatcher(SessionObserver observer)
| Method Detail |
|---|
public void init()
EventDispatcherinit method will be
called by the Connection before it makes any attempt to
add any observers or deliver any events via the dispatcher.
public void destroy()
EventDispatcherdestroy method will be
called by the Connection when it is finished delivering
events to it and the receiver daemon thread is exiting. Any initialising
done in the init method can be cleaned up here.
The destroy method must not interfere with the
delivery of any events notified to the event dispatcher before the call
to this method.
public void notifyObservers(Session conn,
SMPPEvent event)
conn - the Connection with which the event is associated.event - the SMPP event to notify observers of.
public void notifyObservers(Session conn,
SMPPPacket packet)
conn - the Connection which the packet was received on.packet - the received packet to notify observers of.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||