|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.gleamynode.netty2.AbstractThreadPooledEventDispatcher
public abstract class AbstractThreadPooledEventDispatcher
A base class for thread-pooled event dispatchers.
| Nested Class Summary | |
|---|---|
protected class |
AbstractThreadPooledEventDispatcher.AbstractWorker
|
| Field Summary | |
|---|---|
protected List |
workers
|
| Constructor Summary | |
|---|---|
protected |
AbstractThreadPooledEventDispatcher()
|
| Method Summary | |
|---|---|
void |
flush()
(Optional operation) Flushes the buffered events. |
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(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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.gleamynode.netty2.EventDispatcher |
|---|
fire, getWaitingEventSize |
| Field Detail |
|---|
protected final List workers
| Constructor Detail |
|---|
protected AbstractThreadPooledEventDispatcher()
| Method Detail |
|---|
public void start()
ThreadPooledEventDispatcher
start in interface ThreadPooledEventDispatcherpublic void stop()
ThreadPooledEventDispatcher
stop in interface ThreadPooledEventDispatcherpublic boolean isStarted()
ThreadPooledEventDispatchertrue if this event dispatcher is started.
isStarted in interface ThreadPooledEventDispatcherpublic int getThreadPoolSize()
ThreadPooledEventDispatcher
getThreadPoolSize in interface ThreadPooledEventDispatcherpublic void setThreadPoolSize(int newSize)
ThreadPooledEventDispatcher
setThreadPoolSize in interface ThreadPooledEventDispatcherprotected abstract AbstractThreadPooledEventDispatcher.AbstractWorker newWorker()
protected abstract AbstractThreadPooledEventDispatcher.AbstractWorker removeWorker()
public int getThreadPriority()
ThreadPooledEventDispatcher
getThreadPriority in interface ThreadPooledEventDispatcherpublic void setThreadPriority(int newPriority)
ThreadPooledEventDispatcher
setThreadPriority in interface ThreadPooledEventDispatcherpublic String getThreadNamePrefix()
ThreadPooledEventDispatcher
getThreadNamePrefix in interface ThreadPooledEventDispatcherpublic void setThreadNamePrefix(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 EventDispatcher
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||