|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EventDispatcher
This interface defines the observable side of the observer pattern for
asynchronous SMPP event notification. Each com.adenki.smpp.Session
object will have an implementation of the EventDispatcher
interface which it uses to deliver events to interested listeners. By
removing the actual dispatching of events from the internals of the
Connection, applications may provide their own event dispatch implementations
for their Connection objects which better suit how those
applications work.
com.adenki.smpp.event.SimpleEventDispatcher| Method Summary | |
|---|---|
void |
addObserver(SessionObserver observer)
Add an observer to this event dispatcher. |
void |
destroy()
Event dispatcher clean up. |
Collection<SessionObserver> |
getObservers()
Get a read-only collection view of all the observers registered with this event dispatcher. |
void |
init()
Initialise the event dispatcher. |
void |
notifyObservers(Session conn,
SMPPEvent event)
Notify all registered observers of an SMPP event. |
void |
notifyObservers(Session conn,
SMPPPacket packet)
Notify all registered observers of a received SMPP packet. |
Iterator<SessionObserver> |
observerIterator()
Get an iterator over the currently registered observers. |
void |
removeObserver(SessionObserver observer)
Remove an observer from this event dispatcher. |
| Method Detail |
|---|
void init()
init method will be
called by the Connection before it makes any attempt to
add any observers or deliver any events via the dispatcher.
void destroy()
destroy 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.
void addObserver(SessionObserver observer)
observer - the observer object to add.void removeObserver(SessionObserver observer)
observer - the observer object to remove from the registered observers.Collection<SessionObserver> getObservers()
Iterator<SessionObserver> observerIterator()
void notifyObservers(Session conn,
SMPPEvent event)
event - the SMPP event to notify observers of.
void notifyObservers(Session conn,
SMPPPacket packet)
packet - the SMPP packet to notify observers of.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||