use of javax.naming.event.NamingListener in project jdk8u_jdk by JetBrains.
the class EventQueue method run.
/**
* Pull events off the queue and dispatch them.
*/
public void run() {
QueueElement qe;
try {
while ((qe = dequeue()) != null) {
EventObject e = qe.event;
Vector<NamingListener> v = qe.vector;
for (int i = 0; i < v.size(); i++) {
if (e instanceof NamingEvent) {
((NamingEvent) e).dispatch(v.elementAt(i));
// An exception occurred: if notify all naming listeners
} else if (e instanceof NamingExceptionEvent) {
((NamingExceptionEvent) e).dispatch(v.elementAt(i));
} else if (e instanceof UnsolicitedNotificationEvent) {
((UnsolicitedNotificationEvent) e).dispatch((UnsolicitedNotificationListener) v.elementAt(i));
}
}
qe = null;
e = null;
v = null;
}
} catch (InterruptedException e) {
// just die
}
}
Aggregations