|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.Notifier
public class Notifier
Implements the Jacl version of the Notifier class. The Notifier is the lowest-level part of the event system. It is used by higher-level event sources such as file, JavaBean and timer events. The Notifier manages an event queue that holds TclEvent objects. The Jacl notifier is designed to run in a multi-threaded environment. Each notifier instance is associated with a primary thread. Any thread can queue (or dequeue) events using the queueEvent (or deleteEvents) call. However, only the primary thread may process events in the queue using the doOneEvent() call. Attepmts to call doOneEvent from a non-primary thread will cause a TclRuntimeError. This class does not have a public constructor and thus cannot be instantiated. The only way to for a Tcl extension to get an Notifier is to call Interp.getNotifier() (or Notifier.getNotifierForThread() ), which returns the Notifier for that interpreter (thread).
Method Summary | |
---|---|
int |
deleteEvent(TclEvent evt)
Deprecated. |
void |
deleteEvents(EventDeleter deleter)
Calls an EventDeleter for each event in the queue and deletes those for which deleter.deleteEvent() returns 1. |
int |
doOneEvent(int flags)
Process a single event of some sort. |
static Notifier |
getNotifierForThread(Thread thread)
Get the notifier for this thread, creating the Notifier, when necessary. |
boolean |
hasActiveInterps()
|
void |
preserve()
Increment the reference count of the notifier. |
static void |
processTclEvents(Notifier notifier)
|
void |
queueEvent(TclEvent evt,
int position)
Insert an event into the event queue at one of three positions: the head, the tail, or before a floating marker. |
void |
release()
Decrement the reference count of the notifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Notifier getNotifierForThread(Thread thread)
thread
- the thread that owns this notifier
public void preserve()
public void release()
public void queueEvent(TclEvent evt, int position)
evt
- the event to be put on the queueposition
- one of TCL.QUEUE_TAIL, TCL.QUEUE_HEAD or TCL.QUEUE_MARK.public void deleteEvents(EventDeleter deleter)
deleter
- the deleter that checks whether an event should be removed@Deprecated public int deleteEvent(TclEvent evt)
deleteEvent
in interface EventDeleter
evt
- Event to test whether it should be removed
public int doOneEvent(int flags)
flags
- Miscellaneous flag values: may be any combination of
TCL.DONT_WAIT, TCL.WINDOW_EVENTS, TCL.FILE_EVENTS,
TCL.TIMER_EVENTS, TCL.IDLE_EVENTS, or others defined by
event sources.
public boolean hasActiveInterps()
public static void processTclEvents(Notifier notifier)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |