|
||||||||||
| 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.TaskExecutorEventDispatcher
public class TaskExecutorEventDispatcher
Implementation of the EventDispatcher that uses Java's
Executor framework to dispatch events. If no other executor
is supplied, then a ThreadPoolExecutor will be created
at init() time.
The number of threads created in the ThreadPoolExecutor
is determined from the threadCount
property, which by default is set to 0. If the application
does not override this value, then the APIConfig will
be consulted for the APIConfig.EVENT_THREAD_POOL_SIZE property. If
no value is set there, then a default value of 3 will be used.
| Constructor Summary | |
|---|---|
TaskExecutorEventDispatcher()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Event dispatcher clean up. |
Executor |
getExecutor()
|
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. |
void |
setExecutor(Executor executor)
|
void |
setThreadCount(int threadCount)
Set the number of threads to create in a ThreadPoolExecutor for event dispatching. |
| 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 TaskExecutorEventDispatcher()
| Method Detail |
|---|
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 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 notifyObservers(Session conn,
SMPPEvent event)
EventDispatcher
event - the SMPP event to notify observers of.
public void notifyObservers(Session conn,
SMPPPacket packet)
EventDispatcher
packet - the SMPP packet to notify observers of.public void setThreadCount(int threadCount)
threadCount - The number of threads to create in the thread pool.public Executor getExecutor()
public void setExecutor(Executor executor)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||