| java.lang.Object com.sun.midp.util.SerialCallback
SerialCallback | public class SerialCallback implements Runnable(Code) | | An adaptor class that lets a caller synchronize with the event thread. The
invokeAndWait() method enqueues an event using Display.callSerially() and
blocks the caller. When the event reaches the front of the queue, it calls
this object's run() method on the event thread, and unblocks the caller.
Clients may override the run() method if they wish to provide specialized
behavior that must be run on the event thread. If run() is not overridden,
invokeAndWait() simply blocks until the event thread has processed the
event. This is useful for callers that need to wait until after an event
has been processed.
The invokeAndWait() method must not be called on the event thread,
otherwise the system will deadlock.
|
Inner Class :class Callback implements Runnable | |
Constructor Summary | |
public | SerialCallback(Display dpy) Constructs this callback object. |
Method Summary | |
synchronized void | called() Called on the event thread when the callSerially event reaches the
front of the queue. | public synchronized void | invokeAndWait() Blocks the caller until the events currently in the event queue have
been processed, calls the run() method on the event thread, then
unblocks the caller. | public void | run() Subclassers may override this if they wish to provide any specialized
behavior. |
callback | Callback callback(Code) | | |
SerialCallback | public SerialCallback(Display dpy)(Code) | | Constructs this callback object. Requires a Display object upon which
the callSerially() method is to be invoked.
|
called | synchronized void called()(Code) | | Called on the event thread when the callSerially event reaches the
front of the queue. Calls the client's run() method and awakens the
thread that had called invokeAndWait().
|
invokeAndWait | public synchronized void invokeAndWait()(Code) | | Blocks the caller until the events currently in the event queue have
been processed, calls the run() method on the event thread, then
unblocks the caller.
|
run | public void run()(Code) | | Subclassers may override this if they wish to provide any specialized
behavior. The default implementation does nothing.
|
|
|