public abstract class AbstractThreadPooledEventDispatcher extends java.lang.Object implements ThreadPooledEventDispatcher
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractThreadPooledEventDispatcher.AbstractWorker |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List |
workers |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractThreadPooledEventDispatcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
(Optional operation) Flushes the buffered events.
|
java.lang.String |
getThreadNamePrefix()
Returns the prefix of dispatcher thread name.
|
int |
getThreadPoolSize()
Returns the number of dispatcher threads.
|
int |
getThreadPriority()
Returns the priority of dispatcher threads.
|
boolean |
isStarted()
Returns
true if this event dispatcher is started. |
protected abstract AbstractThreadPooledEventDispatcher.AbstractWorker |
newWorker() |
protected abstract AbstractThreadPooledEventDispatcher.AbstractWorker |
removeWorker() |
void |
setThreadNamePrefix(java.lang.String threadNamePrefix)
Sets the prefix of dispatcher thread name.
|
void |
setThreadPoolSize(int newSize)
Sets the number of dispatcher threads.
|
void |
setThreadPriority(int newPriority)
Sets the priority of dispatcher threads.
|
void |
start()
Starts this event dispatcher.
|
void |
stop()
Stops this event dispatcher.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfire, getWaitingEventSizeprotected AbstractThreadPooledEventDispatcher()
public void start()
ThreadPooledEventDispatcherstart in interface ThreadPooledEventDispatcherpublic void stop()
ThreadPooledEventDispatcherstop in interface ThreadPooledEventDispatcherpublic boolean isStarted()
ThreadPooledEventDispatchertrue if this event dispatcher is started.isStarted in interface ThreadPooledEventDispatcherpublic int getThreadPoolSize()
ThreadPooledEventDispatchergetThreadPoolSize in interface ThreadPooledEventDispatcherpublic void setThreadPoolSize(int newSize)
ThreadPooledEventDispatchersetThreadPoolSize in interface ThreadPooledEventDispatcherprotected abstract AbstractThreadPooledEventDispatcher.AbstractWorker newWorker()
protected abstract AbstractThreadPooledEventDispatcher.AbstractWorker removeWorker()
public int getThreadPriority()
ThreadPooledEventDispatchergetThreadPriority in interface ThreadPooledEventDispatcherpublic void setThreadPriority(int newPriority)
ThreadPooledEventDispatchersetThreadPriority in interface ThreadPooledEventDispatcherpublic java.lang.String getThreadNamePrefix()
ThreadPooledEventDispatchergetThreadNamePrefix in interface ThreadPooledEventDispatcherpublic void setThreadNamePrefix(java.lang.String threadNamePrefix)
ThreadPooledEventDispatcherthreadNamePrefix + '-' + threadId.setThreadNamePrefix in interface ThreadPooledEventDispatcherpublic void flush()
EventDispatcherReadController.processEvent(Event)and
WriteController.processEvent(Event)after the expected I/O
operations have been completed. So you can implement
EventDispatcherto buffer the fireXXX calls and
fire (flush) them here in actually.flush in interface EventDispatcherCopyright © 2004-2012 Trustin Lee. All Rights Reserved.