|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread jegg.impl.Dispatcher
Used to dispatch messages to eggs. An instance of this class may be used to dispatch messages to multiple eggs, but it will always dispatch only a single message at a time.
When this class is loaded, a special dispatcher is created that is used to dispatch messages for eggs that were constructed without explicit specification of a dispatcher for the egg.
If a particular egg may take a long time to handle a message dispatched
to it, then that egg should be constructed with its own dispatcher (see
Egg(Object,Dispatcher)
).
The Dispatcher class provides the fundamental mechanism that decouples an Egg implementation from its execution thread. The Dispatcher wraps the thread, not the Egg.
Field Summary | |
static Dispatcher |
DEFAULT_DISPATCHER
The default scheduler |
static java.lang.String |
DEFAULT_DISPATCHER_NAME
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
static Dispatcher |
getAnonymousDispatcher()
|
static Dispatcher |
getDispatcher(java.lang.String name,
boolean start)
|
static java.util.Iterator |
iterator()
|
void |
run()
Implementation of the Thread superclass run method. |
void |
start()
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_DISPATCHER_NAME
public static final Dispatcher DEFAULT_DISPATCHER
Method Detail |
public static java.util.Iterator iterator()
public static Dispatcher getDispatcher(java.lang.String name, boolean start)
public static Dispatcher getAnonymousDispatcher()
public void start()
public final void run()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |