public static final class EConfigure.Dispatcher extends Object implements Comparable<EConfigure.Dispatcher>
Thread priority: minimum,
maximum, or normal thread priority.
Run Queue Type: specifies whether run queue
threads use a blocking, spinning, spin+park, or
spin+yield technique to poll clients from the run
queue.
Spin Limit: if run queue type is either
spin+park or spin+yield, then this is the number of
times the dispatcher thread will poll the run queue
before parking or yielding.
Park Time: if run queue type is spin+park,
then this is the number of nanoseconds the dispatcher
thread will park after the spin limit is reached. When
park returns, the thread will go back to spinning on
poll.
Quantum: nanosecond run quantum assigned to
each client for this dispatcher group. If a client
exhausts this quantum upon completing a task, the
client is placed back on the end of the FIFO run queue
and its quantum is reset to this value. Note that eBus
does not preempt the client. It checks for quantum
exhaustion when the client task returns.
Group thread count: number of dispatcher
threads in this group.
Default group flag: true if this is
the default dispatcher group. If a client is not
assigned to any particular group, then it is assigned
to the default group. If this flag is true,
then the Classes parameter is ignored. There
may be only one default dispatcher group.
Classes: a list of application classes.
Clients which are instances of these classes are
assigned to this dispatcher group. This parameter is
valid only if this is not the default dispatcher
group.
Dispatcher names:
"swing" and
"javafx" (case insensitive).
These Dispatchers use the Swing/JavaFX GUI thread
to deliver eBus messages to a client. This means that the
client callback is free to update the GUI because the
callback code is running on the GUI thread.
Only two properties are supported by special
Dispatchers: EConfigure.DEFAULT_KEY and
EConfigure.CLASSES_KEY. All other properties are ignored by
special Dispatchers. The reason is that the
underlying GUI threads are implemented and configured by
the GUI package and cannot be altered by eBus.
It may be useful to define
the GUI thread Dispatcher as the default Dispatcher and
then create a separate eBus Dispatcher for
non-GUI classes. This way, an application class updating
the display will be assigned to the GUI thread without
needing to add that class to the GUI Dispatcher classes
property.
| Modifier and Type | Method and Description |
|---|---|
Class<?>[] |
classes()
Returns the classes assigned to this dispatcher.
|
int |
compareTo(EConfigure.Dispatcher o) |
EConfigure.DispatcherType |
dispatchType()
Returns the dispatch method type.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isDefault()
Returns
true if this user-defined dispatcher
is the default dispatcher. |
String |
name()
Returns the unique dispatcher name.
|
int |
numberThreads()
Returns the number of threads in this dispatcher.
|
long |
parkTime()
Returns the park time used by
spin+park thread type. |
int |
priority()
Returns the dispatcher thread priority.
|
long |
quantum()
Returns the client run-time quantum assigned by this
dispatcher.
|
ThreadType |
runQueueType()
Returns the thread type which defines how the next
client is acquired from the run queue.
|
long |
spinLimit()
Returns the spin limit used by
spin+park and
spin+yield thread types. |
String |
toString() |
public int compareTo(EConfigure.Dispatcher o)
compareTo in interface Comparable<EConfigure.Dispatcher>public String name()
public EConfigure.DispatcherType dispatchType()
public ThreadType runQueueType()
public long spinLimit()
spin+park and
spin+yield thread types.public long parkTime()
spin+park thread type.public boolean isDefault()
true if this user-defined dispatcher
is the default dispatcher.true if the default dispatcher.public Class<?>[] classes()
null.public int priority()
public long quantum()
public int numberThreads()
Copyright © 2019. All rights reserved.