|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.vat.Runner | +--org.erights.e.elib.vat.SWTRunner
A Runner executing in an SWT event loop.
XXX the orderlyShutdown feature got lost in the reorganization.
Field Summary | |
private Display |
myDisplay
This Display must be created by the new RunnerThread. |
private Object |
myLock
Used to wait until the RunnerThread actually creates and initializes myDisplay. |
private RunnerThread |
myThread
The RunnerThread servicing this Runner's queue. |
private static Object |
OUR_LOCK
Guards mutable static state, ie, THE_DEFAULT |
private static SWTRunner |
THE_DEFAULT
|
Fields inherited from class org.erights.e.elib.vat.Runner |
myOptServingVat, myServingTicket |
Constructor Summary | |
private |
SWTRunner(String optName)
Makes an SWT Vat, and starts the thread that services its queue. |
Method Summary | |
(package private) void |
addDeadManSwitch(Object deadManSwitch)
AWT doesn't shut down or merge, so do nothing. |
(package private) void |
disturbEvent(Throwable t)
Performs a Thread.stop(t) on the thread executing the current event. |
(package private) Throwable |
enqueue(PendingEvent todo)
Add todo to the queue my thread is servicing |
(package private) static Runner |
getDefault()
Returns the default SWTRunner -- the one managing the default Display. |
(package private) String |
getRunnerKind()
What kind of Runner is this? |
(package private) boolean |
isCurrent()
Is the current thread this Runner's thread (the thread servicing this Vat)? |
(package private) static Runner |
make(String name)
Makes an SWTRunner managing a non-default Display. |
void |
run()
Called only by Thread.start(). |
(package private) void |
setPriority(int newPriority)
Requests a change of priority of the thread servicing this Runner. |
String |
toString()
Suppressed: Returns a string representation of the object. |
Methods inherited from class org.erights.e.elib.vat.Runner |
getCurrentRunner, getOptCurrentRunner, getOptEStack, getOptServingVat, obtainRunner, obtainRunner, popEStackItem, pushEStackItem, requireCurrent, servingTicket, shorten |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final Object OUR_LOCK
private static SWTRunner THE_DEFAULT
private final transient RunnerThread myThread
If we ever go orthogonal again, myThread must not be checkpointed. Ie, it must be a DISALLOWED_FIELD or 'transient' or something.
private final Object myLock
private transient Display myDisplay
Constructor Detail |
private SWTRunner(String optName)
The constructor doesn't return until myDisplay is initialized.
optName
- is the name to give to the thread created.Method Detail |
static Runner getDefault()
The first time this is called, it will create the default SWTRunner. The first thing the runner's new thread does when it's scheduled is create a Display. If this is the first Display created in this jvm, then it will be the SWT default Display, so you should not create any Display objects before the first time this is called.
static Runner make(String name)
This should only be called once there is a default Display (as a
result of getDefault()
). Non-default Displays are not
supported by SWT on all platforms.
public String toString()
Object
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
toString
in class Object
String getRunnerKind()
Runner
A kind of Runner determines which kind of "devices" (eg, AWT or SWT widgets) may be synchronously accessed from within this Runner
getRunnerKind
in class Runner
Throwable enqueue(PendingEvent todo)
Runner
enqueue
in class Runner
void setPriority(int newPriority)
Runner
setPriority
in class Runner
void disturbEvent(Throwable t)
Runner
Note that Thread.stop() does not stop the thread (obvious huh?), but rather causes that thread to experience a "spontaneously" thrown exception.
disturbEvent
in class Runner
boolean isCurrent()
Runner
If it is, we say we are executing inside this Runner.
r.isCurrent() implies
Runner.getCurrentRunner()
== r.
isCurrent
in class Runner
public void run()
(XXX It's a modularity bug for this to be public.)
run
in interface Runnable
java.lang.Thread#run()
void addDeadManSwitch(Object deadManSwitch)
addDeadManSwitch
in class Runner
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |