use of javax.naming.ldap.UnsolicitedNotificationEvent 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
}
}
use of javax.naming.ldap.UnsolicitedNotificationEvent in project jdk8u_jdk by JetBrains.
the class EventSupport method fireUnsolicited.
/**
* Fire an event to unsolicited listeners.
* package private;
* Called by LdapCtx when its clnt receives an unsolicited notification.
*/
synchronized void fireUnsolicited(Object obj) {
if (debug) {
System.err.println("EventSupport.fireUnsolicited: " + obj + " " + unsolicited);
}
if (unsolicited == null || unsolicited.size() == 0) {
// before a fired event event reaches here.
return;
}
if (obj instanceof UnsolicitedNotification) {
// Fire UnsolicitedNotification to unsolicited listeners
UnsolicitedNotificationEvent evt = new UnsolicitedNotificationEvent(ctx, (UnsolicitedNotification) obj);
queueEvent(evt, unsolicited);
} else if (obj instanceof NamingException) {
// Fire NamingExceptionEvent to unsolicited listeners.
NamingExceptionEvent evt = new NamingExceptionEvent(ctx, (NamingException) obj);
queueEvent(evt, unsolicited);
// When an exception occurs, the unsolicited listeners
// are automatically deregistered.
// When LdapClient.processUnsolicited() fires a NamingException,
// it will update its listener list so we don't have to.
// Likewise for LdapCtx.
unsolicited = null;
}
}
Aggregations